<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: editor   simple-editor.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>editor&nbsp; <span class="subtitle">2.9.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_editor.html" title="editor">editor</a>
                
                 &gt; simple-editor.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
                        <div class="highlight"><pre><span class="cm">/**</span>
<span class="cm"> * @module editor</span>
<span class="cm"> * @description &lt;p&gt;The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor&#39;s toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.&lt;/p&gt;</span>
<span class="cm"> * @namespace YAHOO.widget</span>
<span class="cm"> * @requires yahoo, dom, element, event, toolbar</span>
<span class="cm"> * @optional animation, container_core, resize, dragdrop</span>
<span class="cm"> */</span>

<span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">,</span>
    <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">,</span>
    <span class="nx">Lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">,</span>
    <span class="nx">Toolbar</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Toolbar</span><span class="p">;</span>

    <span class="cm">/**</span>
<span class="cm">     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor&#39;s toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</span>
<span class="cm">     * @constructor</span>
<span class="cm">     * @class SimpleEditor</span>
<span class="cm">     * @extends YAHOO.util.Element</span>
<span class="cm">     * @param {String/HTMLElement} el The textarea element to turn into an editor.</span>
<span class="cm">     * @param {Object} attrs Object liternal containing configuration parameters.</span>
<span class="cm">    */</span>
    
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">SimpleEditor</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">attrs</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;SimpleEditor Initalizing&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
        
        <span class="kd">var</span> <span class="nx">o</span> <span class="o">=</span> <span class="p">{};</span>
        <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="nx">el</span><span class="p">.</span><span class="nx">tagName</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">attrs</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">Lang</span><span class="p">.</span><span class="nx">augmentObject</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">el</span><span class="p">);</span> <span class="c1">//Break the config reference</span>
            <span class="nx">el</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;textarea&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">DOMReady</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">container</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">c</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">container</span><span class="p">);</span>
                <span class="nx">c</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">attrs</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">Lang</span><span class="p">.</span><span class="nx">augmentObject</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">attrs</span><span class="p">);</span> <span class="c1">//Break the config reference</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="kd">var</span> <span class="nx">oConfig</span> <span class="o">=</span> <span class="p">{</span>
            <span class="nx">element</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
            <span class="nx">attributes</span><span class="o">:</span> <span class="nx">o</span>
        <span class="p">},</span> <span class="nx">id</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">el</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">id</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">id</span> <span class="o">=</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">DOMReady</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="nx">id</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">generateId</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>

        <span class="kd">var</span> <span class="nx">element_cont</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;DIV&#39;</span><span class="p">);</span>
        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">element_cont</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Element</span><span class="p">(</span><span class="nx">element_cont</span><span class="p">,</span> <span class="p">{</span>
            <span class="nx">id</span><span class="o">:</span> <span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_container&#39;</span>
        <span class="p">});</span>
        <span class="kd">var</span> <span class="nx">div</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">div</span><span class="p">,</span> <span class="s1">&#39;first-child&#39;</span><span class="p">);</span>
        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">element_cont</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">div</span><span class="p">);</span>
        
        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">toolbar_cont</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">toolbar_cont</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;DIV&#39;</span><span class="p">);</span>
            <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">toolbar_cont</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_toolbar&#39;</span><span class="p">;</span>
            <span class="nx">div</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">toolbar_cont</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="kd">var</span> <span class="nx">editorWrapper</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;DIV&#39;</span><span class="p">);</span>
        <span class="nx">div</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">editorWrapper</span><span class="p">);</span>
        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">editor_wrapper</span> <span class="o">=</span> <span class="nx">editorWrapper</span><span class="p">;</span>

        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">SimpleEditor</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">constructor</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">);</span>
    <span class="p">};</span>


    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">extend</span><span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">SimpleEditor</span><span class="p">,</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Element</span><span class="p">,</span> <span class="p">{</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _resizeConfig</span>
<span class="cm">        * @description The default config for the Resize Utility</span>
<span class="cm">        */</span>
        <span class="nx">_resizeConfig</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">handles</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;br&#39;</span><span class="p">],</span>
            <span class="nx">autoRatio</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">status</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">proxy</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">useShim</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">setSize</span><span class="o">:</span> <span class="kc">false</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _setupResize</span>
<span class="cm">        * @description Creates the Resize instance and binds its events.</span>
<span class="cm">        */</span>
        <span class="nx">_setupResize</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">DD</span> <span class="o">||</span> <span class="o">!</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Resize</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="kc">false</span><span class="p">;</span> <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;resize&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">config</span> <span class="o">=</span> <span class="p">{};</span>
                <span class="nx">Lang</span><span class="p">.</span><span class="nx">augmentObject</span><span class="p">(</span><span class="nx">config</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_resizeConfig</span><span class="p">);</span> <span class="c1">//Break the config reference</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">resize</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Resize</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">),</span> <span class="nx">config</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">resize</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;resize&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">anim</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;width&#39;</span><span class="p">,</span> <span class="nx">args</span><span class="p">.</span><span class="nx">width</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">args</span><span class="p">.</span><span class="nx">height</span><span class="p">,</span>
                        <span class="nx">th</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">clientHeight</span> <span class="o">+</span> <span class="mi">2</span><span class="p">),</span>
                        <span class="nx">dh</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">dh</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">.</span><span class="nx">clientHeight</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span> <span class="c1">//It has a 1px top border..</span>
                    <span class="p">}</span>
                    <span class="kd">var</span> <span class="nx">newH</span> <span class="o">=</span> <span class="p">(</span><span class="nx">h</span> <span class="o">-</span> <span class="nx">th</span> <span class="o">-</span> <span class="nx">dh</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="nx">newH</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">,</span> <span class="nx">anim</span><span class="p">);</span>
                <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @property resize</span>
<span class="cm">        * @description A reference to the Resize object</span>
<span class="cm">        * @type YAHOO.util.Resize</span>
<span class="cm">        */</span>
        <span class="nx">resize</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _setupDD</span>
<span class="cm">        * @description Sets up the DD instance used from the &#39;drag&#39; config option.</span>
<span class="cm">        */</span>
        <span class="nx">_setupDD</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">DD</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="kc">false</span><span class="p">;</span> <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;drag&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Attaching DD instance to Editor&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;drag&#39;</span><span class="p">),</span>
                    <span class="nx">dd</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">DD</span><span class="p">;</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">d</span> <span class="o">===</span> <span class="s1">&#39;proxy&#39;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">dd</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">DDProxy</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">dd</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">dd</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">));</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="s1">&#39;draggable&#39;</span><span class="p">);</span> 
                <span class="k">this</span><span class="p">.</span><span class="nx">dd</span><span class="p">.</span><span class="nx">setHandleElId</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">_titlebar</span><span class="p">);</span> 
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @property dd</span>
<span class="cm">        * @description A reference to the DragDrop object.</span>
<span class="cm">        * @type YAHOO.util.DD/YAHOO.util.DDProxy</span>
<span class="cm">        */</span>
        <span class="nx">dd</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _lastCommand</span>
<span class="cm">        * @description A cache of the last execCommand (used for Undo/Redo so they don&#39;t mark an undo level)</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">_lastCommand</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="nx">_undoNodeChange</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{},</span>
        <span class="nx">_storeUndo</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _checkKey</span>
<span class="cm">        * @description Checks a keyMap entry against a key event</span>
<span class="cm">        * @param {Object} k The _keyMap object</span>
<span class="cm">        * @param {Event} e The Mouse Event</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">_checkKey</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">k</span><span class="p">,</span> <span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">((</span><span class="nx">e</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">===</span> <span class="nx">k</span><span class="p">.</span><span class="nx">key</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">k</span><span class="p">.</span><span class="nx">mods</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">k</span><span class="p">.</span><span class="nx">mods</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">))</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">val</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">k</span><span class="p">.</span><span class="nx">mods</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">mac</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">k</span><span class="p">.</span><span class="nx">mods</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">==</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">k</span><span class="p">.</span><span class="nx">mods</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;meta&#39;</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">[</span><span class="nx">k</span><span class="p">.</span><span class="nx">mods</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">+</span> <span class="s1">&#39;Key&#39;</span><span class="p">]</span> <span class="o">===</span> <span class="kc">true</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">val</span><span class="o">++</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">val</span> <span class="o">===</span> <span class="nx">k</span><span class="p">.</span><span class="nx">mods</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">//YAHOO.log(&#39;Shortcut Key Check: (&#39; + k.key + &#39;) return: &#39; + ret, &#39;info&#39;, &#39;SimpleEditor&#39;);</span>
            <span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _keyMap</span>
<span class="cm">        * @description Named key maps for various actions in the Editor. Example: &lt;code&gt;CLOSE_WINDOW: { key: 87, mods: [&#39;shift&#39;, &#39;ctrl&#39;] }&lt;/code&gt;. </span>
<span class="cm">        * This entry shows that when key 87 (W) is found with the modifiers of shift and control, the window will close. You can customize this object to tweak keyboard shortcuts.</span>
<span class="cm">        * @type {Object/Mixed}</span>
<span class="cm">        */</span>
        <span class="nx">_keyMap</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">SELECT_ALL</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">65</span><span class="p">,</span> <span class="c1">//A key</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">CLOSE_WINDOW</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">87</span><span class="p">,</span> <span class="c1">//W key</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">FOCUS_TOOLBAR</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">27</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">FOCUS_AFTER</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">27</span>
            <span class="p">},</span>
            <span class="nx">FONT_SIZE_UP</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">38</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">FONT_SIZE_DOWN</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">40</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">CREATE_LINK</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">76</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">BOLD</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">66</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">ITALIC</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">73</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">UNDERLINE</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">85</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">UNDO</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">90</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">REDO</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">90</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">JUSTIFY_LEFT</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">219</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">JUSTIFY_CENTER</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">220</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">},</span>
            <span class="nx">JUSTIFY_RIGHT</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">key</span><span class="o">:</span> <span class="mi">221</span><span class="p">,</span>
                <span class="nx">mods</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;ctrl&#39;</span><span class="p">]</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _cleanClassName</span>
<span class="cm">        * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -&#39;s.</span>
<span class="cm">        * @param {String} str The classname to clean up</span>
<span class="cm">        * @return {String}</span>
<span class="cm">        */</span>
        <span class="nx">_cleanClassName</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">str</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">str</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ /g</span><span class="p">,</span> <span class="s1">&#39;-&#39;</span><span class="p">).</span><span class="nx">toLowerCase</span><span class="p">();</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _textarea</span>
<span class="cm">        * @description Flag to determine if we are using a textarea or an HTML Node.</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_textarea</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _docType</span>
<span class="cm">        * @description The DOCTYPE to use in the editable container.</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">_docType</span><span class="o">:</span> <span class="s1">&#39;&lt;!DOCTYPE HTML PUBLIC &quot;-/&#39;</span><span class="o">+</span><span class="s1">&#39;/W3C/&#39;</span><span class="o">+</span><span class="s1">&#39;/DTD HTML 4.01/&#39;</span><span class="o">+</span><span class="s1">&#39;/EN&quot; &quot;http:/&#39;</span><span class="o">+</span><span class="s1">&#39;/www.w3.org/TR/html4/strict.dtd&quot;&gt;&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property editorDirty</span>
<span class="cm">        * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed.</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">editorDirty</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _defaultCSS</span>
<span class="cm">        * @description The default CSS used in the config for &#39;css&#39;. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + &#39;ADD MYY CSS HERE&#39; }</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">_defaultCSS</span><span class="o">:</span> <span class="s1">&#39;html { height: 95%; } body { padding: 7px; background-color: #fff; font: 13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div.yui-wk-p { margin: 11px 0; } body.ptags.webkit div.yui-wk-div { margin: 0; }&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _defaultToolbar</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Default toolbar config.</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_defaultToolbar</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _lastButton</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description The last button pressed, so we don&#39;t disable it.</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_lastButton</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _baseHREF</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description The base location of the editable page (this page) so that relative paths for image work.</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">_baseHREF</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">href</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">href</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">)</span> <span class="o">!==</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span> <span class="c1">//Remove the query string</span>
                <span class="nx">href</span> <span class="o">=</span> <span class="nx">href</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">href</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">));</span>
            <span class="p">}</span>
            <span class="nx">href</span> <span class="o">=</span> <span class="nx">href</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">href</span><span class="p">.</span><span class="nx">lastIndexOf</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">))</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span><span class="p">;</span>
            <span class="k">return</span> <span class="nx">href</span><span class="p">;</span>
        <span class="p">}(),</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _lastImage</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Safari reference for the last image selected (for styling as selected).</span>
<span class="cm">        * @type HTMLElement</span>
<span class="cm">        */</span>
        <span class="nx">_lastImage</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _blankImageLoaded</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Don&#39;t load the blank image more than once..</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_blankImageLoaded</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _fixNodesTimer</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Holder for the fixNodes timer</span>
<span class="cm">        * @type Date</span>
<span class="cm">        */</span>
        <span class="nx">_fixNodesTimer</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _nodeChangeTimer</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Holds a reference to the nodeChange setTimeout call</span>
<span class="cm">        * @type Number</span>
<span class="cm">        */</span>
        <span class="nx">_nodeChangeTimer</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _nodeChangeDelayTimer</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Holds a reference to the nodeChangeDelay setTimeout call</span>
<span class="cm">        * @type Number</span>
<span class="cm">        */</span>
        <span class="nx">_nodeChangeDelayTimer</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _lastNodeChangeEvent</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Flag to determine the last event that fired a node change</span>
<span class="cm">        * @type Event</span>
<span class="cm">        */</span>
        <span class="nx">_lastNodeChangeEvent</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _lastNodeChange</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Flag to determine when the last node change was fired</span>
<span class="cm">        * @type Date</span>
<span class="cm">        */</span>
        <span class="nx">_lastNodeChange</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _rendered</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Flag to determine if editor has been rendered or not</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_rendered</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property DOMReady</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Flag to determine if DOM is ready or not</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">DOMReady</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _selection</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Holder for caching iframe selections</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_selection</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _mask</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description DOM Element holder for the editor Mask when disabled</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_mask</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property _showingHiddenElements</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Status of the hidden elements button</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_showingHiddenElements</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property currentWindow</span>
<span class="cm">        * @description A reference to the currently open EditorWindow</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">currentWindow</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property currentEvent</span>
<span class="cm">        * @description A reference to the current editor event</span>
<span class="cm">        * @type Event</span>
<span class="cm">        */</span>
        <span class="nx">currentEvent</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property operaEvent</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description setTimeout holder for Opera and Image DoubleClick event..</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">operaEvent</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property currentFont</span>
<span class="cm">        * @description A reference to the last font selected from the Toolbar</span>
<span class="cm">        * @type HTMLElement</span>
<span class="cm">        */</span>
        <span class="nx">currentFont</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property currentElement</span>
<span class="cm">        * @description A reference to the current working element in the editor</span>
<span class="cm">        * @type Array</span>
<span class="cm">        */</span>
        <span class="nx">currentElement</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property dompath</span>
<span class="cm">        * @description A reference to the dompath container for writing the current working dom path to.</span>
<span class="cm">        * @type HTMLElement</span>
<span class="cm">        */</span>
        <span class="nx">dompath</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property beforeElement</span>
<span class="cm">        * @description A reference to the H2 placed before the editor for Accessibilty.</span>
<span class="cm">        * @type HTMLElement</span>
<span class="cm">        */</span>
        <span class="nx">beforeElement</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property afterElement</span>
<span class="cm">        * @description A reference to the H2 placed after the editor for Accessibilty.</span>
<span class="cm">        * @type HTMLElement</span>
<span class="cm">        */</span>
        <span class="nx">afterElement</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property invalidHTML</span>
<span class="cm">        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to &quot;{ keepContents: true }&quot;, then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine.</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">invalidHTML</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">form</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">input</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">button</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">select</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">link</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">html</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">body</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">iframe</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">script</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">style</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="nx">textarea</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @property toolbar</span>
<span class="cm">        * @description Local property containing the &lt;a href=&quot;YAHOO.widget.Toolbar.html&quot;&gt;YAHOO.widget.Toolbar&lt;/a&gt; instance</span>
<span class="cm">        * @type &lt;a href=&quot;YAHOO.widget.Toolbar.html&quot;&gt;YAHOO.widget.Toolbar&lt;/a&gt;</span>
<span class="cm">        */</span>
        <span class="nx">toolbar</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _contentTimer</span>
<span class="cm">        * @description setTimeout holder for documentReady check</span>
<span class="cm">        */</span>
        <span class="nx">_contentTimer</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _contentTimerMax</span>
<span class="cm">        * @description The number of times the loaded content should be checked before giving up. Default: 500</span>
<span class="cm">        */</span>
        <span class="nx">_contentTimerMax</span><span class="o">:</span> <span class="mi">500</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _contentTimerCounter</span>
<span class="cm">        * @description Counter to check the number of times the body is polled for before giving up</span>
<span class="cm">        * @type Number</span>
<span class="cm">        */</span>
        <span class="nx">_contentTimerCounter</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _disabled</span>
<span class="cm">        * @description The Toolbar items that should be disabled if there is no selection present in the editor.</span>
<span class="cm">        * @type Array</span>
<span class="cm">        */</span>
        <span class="nx">_disabled</span><span class="o">:</span> <span class="p">[</span> <span class="s1">&#39;createlink&#39;</span><span class="p">,</span> <span class="s1">&#39;fontname&#39;</span><span class="p">,</span> <span class="s1">&#39;fontsize&#39;</span><span class="p">,</span> <span class="s1">&#39;forecolor&#39;</span><span class="p">,</span> <span class="s1">&#39;backcolor&#39;</span> <span class="p">],</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _alwaysDisabled</span>
<span class="cm">        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_alwaysDisabled</span><span class="o">:</span> <span class="p">{</span> <span class="nx">undo</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">redo</span><span class="o">:</span> <span class="kc">true</span> <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _alwaysEnabled</span>
<span class="cm">        * @description The Toolbar items that should ALWAYS be enabled event if there isn&#39;t a selection present in the editor.</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_alwaysEnabled</span><span class="o">:</span> <span class="p">{</span> <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _semantic</span>
<span class="cm">        * @description The Toolbar commands that we should attempt to make tags out of instead of using styles.</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_semantic</span><span class="o">:</span> <span class="p">{</span> <span class="s1">&#39;bold&#39;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="s1">&#39;italic&#39;</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="s1">&#39;underline&#39;</span> <span class="o">:</span> <span class="kc">true</span> <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _tag2cmd</span>
<span class="cm">        * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button.</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_tag2cmd</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;b&#39;</span><span class="o">:</span> <span class="s1">&#39;bold&#39;</span><span class="p">,</span>
            <span class="s1">&#39;strong&#39;</span><span class="o">:</span> <span class="s1">&#39;bold&#39;</span><span class="p">,</span>
            <span class="s1">&#39;i&#39;</span><span class="o">:</span> <span class="s1">&#39;italic&#39;</span><span class="p">,</span>
            <span class="s1">&#39;em&#39;</span><span class="o">:</span> <span class="s1">&#39;italic&#39;</span><span class="p">,</span>
            <span class="s1">&#39;u&#39;</span><span class="o">:</span> <span class="s1">&#39;underline&#39;</span><span class="p">,</span>
            <span class="s1">&#39;sup&#39;</span><span class="o">:</span> <span class="s1">&#39;superscript&#39;</span><span class="p">,</span>
            <span class="s1">&#39;sub&#39;</span><span class="o">:</span> <span class="s1">&#39;subscript&#39;</span><span class="p">,</span>
            <span class="s1">&#39;img&#39;</span><span class="o">:</span> <span class="s1">&#39;insertimage&#39;</span><span class="p">,</span>
            <span class="s1">&#39;a&#39;</span> <span class="o">:</span> <span class="s1">&#39;createlink&#39;</span><span class="p">,</span>
            <span class="s1">&#39;ul&#39;</span> <span class="o">:</span> <span class="s1">&#39;insertunorderedlist&#39;</span><span class="p">,</span>
            <span class="s1">&#39;ol&#39;</span> <span class="o">:</span> <span class="s1">&#39;insertorderedlist&#39;</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">        * @private _createIframe</span>
<span class="cm">        * @description Creates the DOM and YUI Element for the iFrame editor area.</span>
<span class="cm">        * @param {String} id The string ID to prefix the iframe with</span>
<span class="cm">        * @return {Object} iFrame object</span>
<span class="cm">        */</span>
        <span class="nx">_createIframe</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ifrmDom</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">);</span>
            <span class="nx">ifrmDom</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;_editor&#39;</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">config</span> <span class="o">=</span> <span class="p">{</span>
                <span class="nx">border</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span>
                <span class="nx">frameBorder</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span>
                <span class="nx">marginWidth</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span>
                <span class="nx">marginHeight</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span>
                <span class="nx">leftMargin</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span>
                <span class="nx">topMargin</span><span class="o">:</span> <span class="s1">&#39;0&#39;</span><span class="p">,</span>
                <span class="nx">allowTransparency</span><span class="o">:</span> <span class="s1">&#39;true&#39;</span><span class="p">,</span>
                <span class="nx">width</span><span class="o">:</span> <span class="s1">&#39;100%&#39;</span>
            <span class="p">};</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;autoHeight&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">config</span><span class="p">.</span><span class="nx">scrolling</span> <span class="o">=</span> <span class="s1">&#39;no&#39;</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">config</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">config</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">ifrmDom</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="nx">i</span><span class="p">,</span> <span class="nx">config</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">isrc</span> <span class="o">=</span> <span class="s1">&#39;javascript:;&#39;</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//isrc = &#39;about:blank&#39;;</span>
                <span class="c1">//TODO - Check this, I have changed it before..</span>
                <span class="nx">isrc</span> <span class="o">=</span> <span class="s1">&#39;javascript:false;&#39;</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="nx">ifrmDom</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="nx">isrc</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">ifrm</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Element</span><span class="p">(</span><span class="nx">ifrmDom</span><span class="p">);</span>
            <span class="nx">ifrm</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;hidden&#39;</span><span class="p">);</span>
            <span class="k">return</span> <span class="nx">ifrm</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private _isElement</span>
<span class="cm">        * @description Checks to see if an Element reference is a valid one and has a certain tag type</span>
<span class="cm">        * @param {HTMLElement} el The element to check</span>
<span class="cm">        * @param {String} tag The tag that the element needs to be</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">_isElement</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">tag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="nx">el</span><span class="p">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="nx">tag</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="nx">el</span><span class="p">.</span><span class="nx">getAttribute</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="nx">tag</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private _hasParent</span>
<span class="cm">        * @description Checks to see if an Element reference or one of it&#39;s parents is a valid one and has a certain tag type</span>
<span class="cm">        * @param {HTMLElement} el The element to check</span>
<span class="cm">        * @param {String} tag The tag that the element needs to be</span>
<span class="cm">        * @return HTMLElement</span>
<span class="cm">        */</span>
        <span class="nx">_hasParent</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">tag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">el</span> <span class="o">||</span> <span class="o">!</span><span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            
            <span class="k">while</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">tag</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="nx">el</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _getDoc</span>
<span class="cm">        * @description Get the Document of the IFRAME</span>
<span class="cm">        * @return {Object}</span>
<span class="cm">        */</span>
        <span class="nx">_getDoc</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="k">try</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">contentWindow</span><span class="p">.</span><span class="nb">document</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">contentWindow</span><span class="p">.</span><span class="nb">document</span><span class="p">;</span>
                    <span class="k">return</span> <span class="nx">value</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _getWindow</span>
<span class="cm">        * @description Get the Window of the IFRAME</span>
<span class="cm">        * @return {Object}</span>
<span class="cm">        */</span>
        <span class="nx">_getWindow</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">contentWindow</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method focus</span>
<span class="cm">        * @description Attempt to set the focus of the iframes window.</span>
<span class="cm">        */</span>
        <span class="nx">focus</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">().</span><span class="nx">focus</span><span class="p">();</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @depreciated - This should not be used, moved to this.focus();</span>
<span class="cm">        * @method _focusWindow</span>
<span class="cm">        * @description Attempt to set the focus of the iframes window.</span>
<span class="cm">        */</span>
        <span class="nx">_focusWindow</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;_focusWindow: depreciated in favor of this.focus()&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;Editor&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _hasSelection</span>
<span class="cm">        * @description Determines if there is a selection in the editor document.</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">_hasSelection</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">();</span>
            <span class="kd">var</span> <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">();</span>
            <span class="kd">var</span> <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">sel</span> <span class="o">||</span> <span class="o">!</span><span class="nx">range</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">hasSel</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="c1">//Internet Explorer</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">text</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span><span class="o">+</span><span class="s1">&#39;&#39;</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">toString</span><span class="p">()</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">sel</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">hasSel</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">hasSel</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _getSelection</span>
<span class="cm">        * @description Handles the different selection objects across the A-Grade list.</span>
<span class="cm">        * @return {Object} Selection Object</span>
<span class="cm">        */</span>
        <span class="nx">_getSelection</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">_sel</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">()</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">())</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">selection</span> <span class="o">&amp;&amp;!</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">selection</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">().</span><span class="nx">getSelection</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="c1">//Handle Safari&#39;s lack of Selection Object</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">_sel</span><span class="p">.</span><span class="nx">baseNode</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span> <span class="o">=</span> <span class="p">{};</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">baseNode</span> <span class="o">=</span> <span class="nx">_sel</span><span class="p">.</span><span class="nx">baseNode</span><span class="p">;</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">baseOffset</span> <span class="o">=</span> <span class="nx">_sel</span><span class="p">.</span><span class="nx">baseOffset</span><span class="p">;</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">extentNode</span> <span class="o">=</span> <span class="nx">_sel</span><span class="p">.</span><span class="nx">extentNode</span><span class="p">;</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">extentOffset</span> <span class="o">=</span> <span class="nx">_sel</span><span class="p">.</span><span class="nx">extentOffset</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_selection</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">().</span><span class="nx">getSelection</span><span class="p">();</span>
                        <span class="nx">_sel</span><span class="p">.</span><span class="nx">setBaseAndExtent</span><span class="p">(</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">baseNode</span><span class="p">,</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">baseOffset</span><span class="p">,</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">extentNode</span><span class="p">,</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span><span class="p">.</span><span class="nx">extentOffset</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_selection</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">_sel</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _selectNode</span>
<span class="cm">        * @description Places the highlight around a given node</span>
<span class="cm">        * @param {HTMLElement} node The node to select</span>
<span class="cm">        */</span>
        <span class="nx">_selectNode</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">collapse</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">(),</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">try</span> <span class="p">{</span> <span class="c1">//IE freaks out here sometimes..</span>
                    <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">createTextRange</span><span class="p">();</span>
                    <span class="nx">range</span><span class="p">.</span><span class="nx">moveToElementText</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
                    <span class="nx">range</span><span class="p">.</span><span class="nx">select</span><span class="p">();</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;IE failed to select element: &#39;</span> <span class="o">+</span> <span class="nx">node</span><span class="p">.</span><span class="nx">tagName</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">collapse</span><span class="p">)</span> <span class="p">{</span>
				    <span class="nx">sel</span><span class="p">.</span><span class="nx">setBaseAndExtent</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="nx">node</span><span class="p">,</span> <span class="nx">node</span><span class="p">.</span><span class="nx">innerText</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
				    <span class="nx">sel</span><span class="p">.</span><span class="nx">setBaseAndExtent</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">node</span><span class="p">,</span> <span class="nx">node</span><span class="p">.</span><span class="nx">innerText</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">().</span><span class="nx">getSelection</span><span class="p">();</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createRange</span><span class="p">();</span>
                <span class="nx">range</span><span class="p">.</span><span class="nx">selectNode</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
                <span class="nx">sel</span><span class="p">.</span><span class="nx">removeAllRanges</span><span class="p">();</span>
                <span class="nx">sel</span><span class="p">.</span><span class="nx">addRange</span><span class="p">(</span><span class="nx">range</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createRange</span><span class="p">();</span>
                <span class="nx">range</span><span class="p">.</span><span class="nx">selectNodeContents</span><span class="p">(</span><span class="nx">node</span><span class="p">);</span>
                <span class="nx">sel</span><span class="p">.</span><span class="nx">removeAllRanges</span><span class="p">();</span>
                <span class="nx">sel</span><span class="p">.</span><span class="nx">addRange</span><span class="p">(</span><span class="nx">range</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="c1">//TODO - Check Performance</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _getRange</span>
<span class="cm">        * @description Handles the different range objects across the A-Grade list.</span>
<span class="cm">        * @return {Object} Range Object</span>
<span class="cm">        */</span>
        <span class="nx">_getRange</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">();</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">sel</span><span class="p">.</span><span class="nx">getRangeAt</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createRange</span><span class="p">();</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="nx">_range</span><span class="p">.</span><span class="nx">setStart</span><span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">anchorNode</span><span class="p">,</span> <span class="nx">sel</span><span class="p">.</span><span class="nx">anchorOffset</span><span class="p">);</span>
                    <span class="nx">_range</span><span class="p">.</span><span class="nx">setEnd</span><span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">focusNode</span><span class="p">,</span> <span class="nx">sel</span><span class="p">.</span><span class="nx">focusOffset</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">().</span><span class="nx">getSelection</span><span class="p">()</span><span class="o">+</span><span class="s1">&#39;&#39;</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">return</span> <span class="nx">_range</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="nx">sel</span><span class="p">.</span><span class="nx">createRange</span><span class="p">();</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e2</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">rangeCount</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">sel</span><span class="p">.</span><span class="nx">getRangeAt</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _setDesignMode</span>
<span class="cm">        * @description Sets the designMode property of the iFrame document&#39;s body.</span>
<span class="cm">        * @param {String} state This should be either on or off</span>
<span class="cm">        */</span>
        <span class="nx">_setDesignMode</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">state</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;setDesignMode&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">designMode</span> <span class="o">=</span> <span class="p">((</span><span class="nx">state</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;off&#39;</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;off&#39;</span> <span class="o">:</span> <span class="s1">&#39;on&#39;</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _toggleDesignMode</span>
<span class="cm">        * @description Toggles the designMode property of the iFrame document on and off.</span>
<span class="cm">        * @return {String} The state that it was set to.</span>
<span class="cm">        */</span>
        <span class="nx">_toggleDesignMode</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;It is not recommended to use this method and it will be depreciated.&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">_dMode</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">designMode</span><span class="p">,</span>
                <span class="nx">_state</span> <span class="o">=</span> <span class="p">((</span><span class="nx">_dMode</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;on&#39;</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;off&#39;</span> <span class="o">:</span> <span class="s1">&#39;on&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setDesignMode</span><span class="p">(</span><span class="nx">_state</span><span class="p">);</span>
            <span class="k">return</span> <span class="nx">_state</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _focused</span>
<span class="cm">        * @description Holder for trapping focus/blur state and prevent double events</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_focused</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleFocus</span>
<span class="cm">        * @description Handles the focus of the iframe. Note, this is window focus event, not an Editor focus event.</span>
<span class="cm">        * @param {Event} e The DOM Event</span>
<span class="cm">        */</span>
        <span class="nx">_handleFocus</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_focused</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//YAHOO.log(&#39;Editor Window Focused&#39;, &#39;info&#39;, &#39;SimpleEditor&#39;);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_focused</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorWindowFocus&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorWindowFocus&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleBlur</span>
<span class="cm">        * @description Handles the blur of the iframe. Note, this is window blur event, not an Editor blur event.</span>
<span class="cm">        * @param {Event} e The DOM Event</span>
<span class="cm">        */</span>
        <span class="nx">_handleBlur</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_focused</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//YAHOO.log(&#39;Editor Window Blurred&#39;, &#39;info&#39;, &#39;SimpleEditor&#39;);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_focused</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorWindowBlur&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorWindowBlur&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _initEditorEvents</span>
<span class="cm">        * @description This method sets up the listeners on the Editors document.</span>
<span class="cm">        */</span>
        <span class="nx">_initEditorEvents</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="c1">//Setup Listeners on iFrame</span>
            <span class="kd">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">(),</span>
                <span class="nx">win</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">();</span>

            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;mouseup&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleMouseUp</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;mousedown&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleMouseDown</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;click&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;dblclick&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleDoubleClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;keypress&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleKeyPress</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;keyup&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleKeyUp</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;keydown&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleKeyDown</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="cm">/* TODO -- Everyone but Opera works here..</span>
<span class="cm">            Event.on(doc, &#39;paste&#39;, function() {</span>
<span class="cm">                YAHOO.log(&#39;PASTE&#39;, &#39;info&#39;, &#39;SimpleEditor&#39;);</span>
<span class="cm">            }, this, true);</span>
<span class="cm">            */</span>
 
            <span class="c1">//Focus and blur..</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">win</span><span class="p">,</span> <span class="s1">&#39;focus&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFocus</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">win</span><span class="p">,</span> <span class="s1">&#39;blur&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleBlur</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _removeEditorEvents</span>
<span class="cm">        * @description This method removes the listeners on the Editors document (for disabling).</span>
<span class="cm">        */</span>
        <span class="nx">_removeEditorEvents</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="c1">//Remove Listeners on iFrame</span>
            <span class="kd">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">(),</span>
                <span class="nx">win</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">();</span>

            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;mouseup&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleMouseUp</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;mousedown&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleMouseDown</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;click&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;dblclick&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleDoubleClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;keypress&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleKeyPress</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;keyup&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleKeyUp</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="s1">&#39;keydown&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleKeyDown</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

            <span class="c1">//Focus and blur..</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">win</span><span class="p">,</span> <span class="s1">&#39;focus&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFocus</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">win</span><span class="p">,</span> <span class="s1">&#39;blur&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleBlur</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="nx">_fixWebkitDivs</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">divs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
                <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">divs</span><span class="p">,</span> <span class="s1">&#39;yui-wk-div&#39;</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _initEditor</span>
<span class="cm">        * @param {Boolean} raw Don&#39;t add events.</span>
<span class="cm">        * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set&#39;s up the listeners.</span>
<span class="cm">        */</span>
        <span class="nx">_initEditor</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">raw</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_editorInit</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_editorInit</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">margin</span> <span class="o">=</span> <span class="s1">&#39;0&#39;</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_setDesignMode</span><span class="p">(</span><span class="s1">&#39;on&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_contentTimerCounter</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Body is null, check again&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_contentTimerCounter</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_editorInit</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_checkLoaded</span><span class="p">();</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;editorLoaded&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">raw</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;buttonClick&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleToolbarClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_initEditorEvents</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">raw</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorContentReloaded&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorreloaded&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorContentLoaded&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorLoaded&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_fixWebkitDivs</span><span class="p">();</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;dompath&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Delayed DomPath write&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_writeDomPath</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_setupResize</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                <span class="p">},</span> <span class="mi">150</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">br</span> <span class="o">=</span> <span class="p">[];</span>
            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="p">{</span>
                    <span class="nx">br</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;ptags&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">br</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="s1">&#39;ptags&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">,</span> <span class="nx">br</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">));</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _checkLoaded</span>
<span class="cm">        * @param {Boolean} raw Don&#39;t add events.</span>
<span class="cm">        * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor.</span>
<span class="cm">        */</span>
        <span class="nx">_checkLoaded</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">raw</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_editorInit</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_contentTimerCounter</span><span class="o">++</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_contentTimer</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">clearTimeout</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_contentTimer</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_contentTimerCounter</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_contentTimerMax</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;ERROR: Body Did Not load&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">init</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="k">try</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">()</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">readyState</span> <span class="o">==</span> <span class="s1">&#39;complete&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">init</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">_rteLoaded</span> <span class="o">===</span> <span class="kc">true</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">init</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">init</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;checking body (e)&#39;</span> <span class="o">+</span> <span class="nx">e</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">init</span> <span class="o">===</span> <span class="kc">true</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//The onload event has fired, clean up after ourselves and fire the _initEditor method</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Firing _initEditor&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_initEditor</span><span class="p">(</span><span class="nx">raw</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_contentTimer</span> <span class="o">=</span> <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_checkLoaded</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">,</span> <span class="nx">raw</span><span class="p">);</span>
                <span class="p">},</span> <span class="mi">20</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _setInitialContent</span>
<span class="cm">        * @param {Boolean} raw Don&#39;t add events.</span>
<span class="cm">        * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.</span>
<span class="cm">        */</span>
        <span class="nx">_setInitialContent</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">raw</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Populating editor body with contents of the text area&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>

            <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">_textarea</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">value</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">innerHTML</span><span class="p">),</span>
                <span class="nx">doc</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">===</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">value</span> <span class="o">=</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="kd">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">substitute</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;html&#39;</span><span class="p">),</span> <span class="p">{</span>
                <span class="nx">TITLE</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">STR_TITLE</span><span class="p">,</span>
                <span class="nx">CONTENT</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_cleanIncomingHTML</span><span class="p">(</span><span class="nx">value</span><span class="p">),</span>
                <span class="nx">CSS</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;css&#39;</span><span class="p">),</span>
                <span class="nx">HIDDEN_CSS</span><span class="o">:</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;hiddencss&#39;</span><span class="p">))</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;hiddencss&#39;</span><span class="p">)</span> <span class="o">:</span> <span class="s1">&#39;/* No Hidden CSS */&#39;</span><span class="p">),</span>
                <span class="nx">EXTRA_CSS</span><span class="o">:</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;extracss&#39;</span><span class="p">))</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;extracss&#39;</span><span class="p">)</span> <span class="o">:</span> <span class="s1">&#39;/* No Extra CSS */&#39;</span><span class="p">)</span>
            <span class="p">}),</span>
            <span class="nx">check</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/RIGHT_BRACKET/gi</span><span class="p">,</span> <span class="s1">&#39;{&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/LEFT_BRACKET/gi</span><span class="p">,</span> <span class="s1">&#39;}&#39;</span><span class="p">);</span>

            <span class="k">if</span> <span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">compatMode</span> <span class="o">!=</span> <span class="s1">&#39;BackCompat&#39;</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Adding Doctype to editable area&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_docType</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span> <span class="o">+</span> <span class="nx">html</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;DocType skipped because we are in BackCompat Mode.&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span> <span class="o">||</span> <span class="p">(</span><span class="nx">navigator</span><span class="p">.</span><span class="nx">userAgent</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;Firefox/1.5&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//Firefox 1.5 doesn&#39;t like setting designMode on an document created with a data url</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="c1">//Adobe AIR Code</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">air</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">implementation</span><span class="p">.</span><span class="nx">createHTMLDocument</span><span class="p">();</span>
                        <span class="kd">var</span> <span class="nx">origDoc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">();</span>
                        <span class="nx">origDoc</span><span class="p">.</span><span class="nx">open</span><span class="p">();</span>
                        <span class="nx">origDoc</span><span class="p">.</span><span class="nx">close</span><span class="p">();</span>
                        <span class="nx">doc</span><span class="p">.</span><span class="nx">open</span><span class="p">();</span>
                        <span class="nx">doc</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>
                        <span class="nx">doc</span><span class="p">.</span><span class="nx">close</span><span class="p">();</span>
                        <span class="kd">var</span> <span class="nx">node</span> <span class="o">=</span> <span class="nx">origDoc</span><span class="p">.</span><span class="nx">importNode</span><span class="p">(</span><span class="nx">doc</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;html&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">],</span> <span class="kc">true</span><span class="p">);</span>
                        <span class="nx">origDoc</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="nx">origDoc</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;html&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]);</span>
                        <span class="nx">origDoc</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">_rteLoaded</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">();</span>
                        <span class="nx">doc</span><span class="p">.</span><span class="nx">open</span><span class="p">();</span>
                        <span class="nx">doc</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>
                        <span class="nx">doc</span><span class="p">.</span><span class="nx">close</span><span class="p">();</span>
                    <span class="p">}</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Setting doc failed.. (_setInitialContent)&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="c1">//Safari will only be here if we are hidden</span>
                    <span class="nx">check</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="c1">//This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">src</span> <span class="o">=</span> <span class="s1">&#39;data:text/html;charset=utf-8,&#39;</span> <span class="o">+</span> <span class="nb">encodeURIComponent</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">check</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_checkLoaded</span><span class="p">(</span><span class="nx">raw</span><span class="p">);</span>
            <span class="p">}</span>            
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _setMarkupType</span>
<span class="cm">        * @param {String} action The action to take. Possible values are: css, default or semantic</span>
<span class="cm">        * @description This method will turn on/off the useCSS execCommand.</span>
<span class="cm">        */</span>
        <span class="nx">_setMarkupType</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">action</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">switch</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;markup&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">case</span> <span class="s1">&#39;css&#39;</span><span class="o">:</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_setEditorStyle</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="k">case</span> <span class="s1">&#39;default&#39;</span><span class="o">:</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_setEditorStyle</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="k">case</span> <span class="s1">&#39;semantic&#39;</span><span class="o">:</span>
                <span class="k">case</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_semantic</span><span class="p">[</span><span class="nx">action</span><span class="p">])</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_setEditorStyle</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_setEditorStyle</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * Set the editor to use CSS instead of HTML</span>
<span class="cm">        * @param {Booleen} stat True/False</span>
<span class="cm">        */</span>
        <span class="nx">_setEditorStyle</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">stat</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">try</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;useCSS&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="o">!</span><span class="nx">stat</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">ex</span><span class="p">)</span> <span class="p">{</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _getSelectedElement</span>
<span class="cm">        * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.</span>
<span class="cm">        * @return {HTMLElement} The currently selected element.</span>
<span class="cm">        */</span>
        <span class="nx">_getSelectedElement</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">(),</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">sel</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">check</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">().</span><span class="nx">event</span><span class="p">;</span> <span class="c1">//Event utility assumes window.event, so we need to reset it to this._getWindow().event;</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="p">.</span><span class="nx">item</span> <span class="o">?</span> <span class="nx">range</span><span class="p">.</span><span class="nx">item</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">:</span> <span class="nx">range</span><span class="p">.</span><span class="nx">parentElement</span><span class="p">();</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                        <span class="c1">//TODO</span>
                        <span class="c1">//WTF.. Why can&#39;t I get an element reference here?!??!</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">elm</span> <span class="o">===</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">body</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">===</span> <span class="mi">0</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">elm</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">();</span>
                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">();</span>

                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">sel</span> <span class="o">||</span> <span class="o">!</span><span class="nx">range</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="c1">//TODO</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">()</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">//check = false;</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">gecko</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">//Added in 2.6.0</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">===</span> <span class="mi">3</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">===</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="c1">//Added in 2.7.0</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">)</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">);</span>
                            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;html&#39;</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="nx">elm</span> <span class="o">!==</span> <span class="nx">tar</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="nx">elm</span> <span class="o">=</span> <span class="nx">tar</span><span class="p">;</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                
                <span class="k">if</span> <span class="p">(</span><span class="nx">check</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">anchorNode</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">anchorNode</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="mi">3</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">anchorNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span> <span class="c1">//next check parentNode</span>
                            <span class="nx">elm</span> <span class="o">=</span> <span class="nx">sel</span><span class="p">.</span><span class="nx">anchorNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">anchorNode</span><span class="p">.</span><span class="nx">nextSibling</span> <span class="o">!=</span> <span class="nx">sel</span><span class="p">.</span><span class="nx">focusNode</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elm</span> <span class="o">=</span> <span class="nx">sel</span><span class="p">.</span><span class="nx">anchorNode</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;br&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">elm</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="p">.</span><span class="nx">commonAncestorContainer</span><span class="p">;</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">range</span><span class="p">.</span><span class="nx">collapsed</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span> <span class="o">==</span> <span class="nx">range</span><span class="p">.</span><span class="nx">endContainer</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">startOffset</span> <span class="o">-</span> <span class="nx">range</span><span class="p">.</span><span class="nx">endOffset</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span><span class="p">.</span><span class="nx">hasChildNodes</span><span class="p">())</span> <span class="p">{</span>
                                        <span class="nx">elm</span> <span class="o">=</span> <span class="nx">range</span><span class="p">.</span><span class="nx">startContainer</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">range</span><span class="p">.</span><span class="nx">startOffset</span><span class="p">];</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
               <span class="p">}</span>
            <span class="p">}</span>
            
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="k">switch</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">.</span><span class="nx">type</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">case</span> <span class="s1">&#39;click&#39;</span><span class="o">:</span>
                        <span class="k">case</span> <span class="s1">&#39;mousedown&#39;</span><span class="o">:</span>
                        <span class="k">case</span> <span class="s1">&#39;mouseup&#39;</span><span class="o">:</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">);</span>
                            <span class="p">}</span>
                            <span class="k">break</span><span class="p">;</span>
                        <span class="k">default</span><span class="o">:</span>
                            <span class="c1">//Do nothing</span>
                            <span class="k">break</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Firefox 1.5 errors here: &#39;</span> <span class="o">+</span> <span class="nx">e</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//TODO is this still needed?</span>
                <span class="c1">//elm = this.currentElement[0];</span>
            <span class="p">}</span>


            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">elm</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">elm</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">elm</span> <span class="o">||</span> <span class="o">!</span><span class="nx">elm</span><span class="p">.</span><span class="nx">tagName</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">body</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;html&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//Safari sometimes gives us the HTML node back..</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">body</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//make sure that body means this body not the parent..</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">body</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">elm</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">elm</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span> <span class="c1">//Not in document</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">body</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">elm</span> <span class="o">===</span> <span class="kc">undefined</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">elm</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _getDomPath</span>
<span class="cm">        * @description This method will attempt to build the DOM path from the currently selected element.</span>
<span class="cm">        * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used</span>
<span class="cm">        * @return {Array} An array of node references that will create the DOM Path.</span>
<span class="cm">        */</span>
        <span class="nx">_getDomPath</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
			    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
            <span class="p">}</span>
			<span class="kd">var</span> <span class="nx">domPath</span> <span class="o">=</span> <span class="p">[];</span>
            <span class="k">while</span> <span class="p">(</span><span class="nx">el</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">ownerDocument</span> <span class="o">!=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">())</span> <span class="p">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="c1">//Check to see if we get el.nodeName and nodeType</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">el</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">domPath</span><span class="p">[</span><span class="nx">domPath</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">domPath</span><span class="p">.</span><span class="nx">length</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">()</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">domPath</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">domPath</span><span class="p">.</span><span class="nx">reverse</span><span class="p">();</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _writeDomPath</span>
<span class="cm">        * @description Write the current DOM path out to the dompath container below the editor.</span>
<span class="cm">        */</span>
        <span class="nx">_writeDomPath</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> 
            <span class="kd">var</span> <span class="nx">path</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDomPath</span><span class="p">(),</span>
                <span class="nx">pathArr</span> <span class="o">=</span> <span class="p">[],</span>
                <span class="nx">classPath</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
                <span class="nx">pathStr</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>

            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">path</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">((</span><span class="nx">tag</span> <span class="o">==</span> <span class="s1">&#39;ol&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">type</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">tag</span> <span class="o">+=</span> <span class="s1">&#39;:&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">type</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;yui-tag&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;markup&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;semantic&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;markup&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">switch</span> <span class="p">(</span><span class="nx">tag</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">case</span> <span class="s1">&#39;b&#39;</span><span class="o">:</span> <span class="nx">tag</span> <span class="o">=</span> <span class="s1">&#39;strong&#39;</span><span class="p">;</span> <span class="k">break</span><span class="p">;</span>
                        <span class="k">case</span> <span class="s1">&#39;i&#39;</span><span class="o">:</span> <span class="nx">tag</span> <span class="o">=</span> <span class="s1">&#39;em&#39;</span><span class="p">;</span> <span class="k">break</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;yui-non&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;yui-tag&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="nx">tag</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">classPath</span> <span class="o">=</span> <span class="p">((</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">className</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;.&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">className</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ /g</span><span class="p">,</span> <span class="s1">&#39;.&#39;</span><span class="p">)</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">((</span><span class="nx">classPath</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;yui&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">classPath</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;apple-style-span&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">classPath</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="nx">tag</span> <span class="o">+</span> <span class="p">((</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;#&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="nx">classPath</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">switch</span> <span class="p">(</span><span class="nx">tag</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">case</span> <span class="s1">&#39;body&#39;</span><span class="o">:</span>
                            <span class="nx">pathStr</span> <span class="o">=</span> <span class="s1">&#39;body&#39;</span><span class="p">;</span>
                            <span class="k">break</span><span class="p">;</span>
                        <span class="k">case</span> <span class="s1">&#39;a&#39;</span><span class="o">:</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;href&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> <span class="p">{</span>
                                <span class="nx">pathStr</span> <span class="o">+=</span> <span class="s1">&#39;:&#39;</span> <span class="o">+</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;href&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="s1">&#39;mailto:&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="s1">&#39;http:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="s1">&#39;https:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span> <span class="c1">//May need to add others here ftp</span>
                            <span class="p">}</span>
                            <span class="k">break</span><span class="p">;</span>
                        <span class="k">case</span> <span class="s1">&#39;img&#39;</span><span class="o">:</span>
                            <span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">height</span><span class="p">;</span>
                            <span class="kd">var</span> <span class="nx">w</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">width</span><span class="p">;</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">height</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">h</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">height</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span>
                            <span class="p">}</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">w</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span>
                            <span class="p">}</span>
                            <span class="nx">pathStr</span> <span class="o">+=</span> <span class="s1">&#39;(&#39;</span> <span class="o">+</span> <span class="nx">w</span> <span class="o">+</span> <span class="s1">&#39;x&#39;</span> <span class="o">+</span> <span class="nx">h</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="p">;</span>
                        <span class="k">break</span><span class="p">;</span>
                    <span class="p">}</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">pathStr</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">10</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="s1">&#39;&lt;span title=&quot;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;...&#39;</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">pathStr</span> <span class="o">=</span> <span class="s1">&#39;&lt;span title=&quot;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">pathStr</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="nx">pathArr</span><span class="p">[</span><span class="nx">pathArr</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">pathStr</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="nx">pathArr</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">SEP_DOMPATH</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span><span class="p">);</span>
            <span class="c1">//Prevent flickering</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">!=</span> <span class="nx">str</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _fixNodes</span>
<span class="cm">        * @description Fix href and imgs as well as remove invalid HTML.</span>
<span class="cm">        */</span>
        <span class="nx">_fixNodes</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">try</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">(),</span>
                    <span class="nx">els</span> <span class="o">=</span> <span class="p">[];</span>

                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">v</span> <span class="k">in</span> <span class="k">this</span><span class="p">.</span><span class="nx">invalidHTML</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">invalidHTML</span><span class="p">,</span> <span class="nx">v</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">v</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">!=</span> <span class="s1">&#39;span&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">tags</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="nx">v</span><span class="p">);</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">tags</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">tags</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="nx">els</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">tags</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">h</span> <span class="o">&lt;</span> <span class="nx">els</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">h</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">els</span><span class="p">[</span><span class="nx">h</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">invalidHTML</span><span class="p">[</span><span class="nx">els</span><span class="p">[</span><span class="nx">h</span><span class="p">].</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()])</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">invalidHTML</span><span class="p">[</span><span class="nx">els</span><span class="p">[</span><span class="nx">h</span><span class="p">].</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()].</span><span class="nx">keepContents</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_swapEl</span><span class="p">(</span><span class="nx">els</span><span class="p">[</span><span class="nx">h</span><span class="p">],</span> <span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">el</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-non&#39;</span><span class="p">;</span>
                            <span class="p">});</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">els</span><span class="p">[</span><span class="nx">h</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">els</span><span class="p">[</span><span class="nx">h</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="kd">var</span> <span class="nx">imgs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">);</span>
                <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">imgs</span><span class="p">,</span> <span class="s1">&#39;yui-img&#39;</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _isNonEditable</span>
<span class="cm">        * @param Event ev The Dom event being checked</span>
<span class="cm">        * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied.</span>
<span class="cm">        * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also</span>
<span class="cm">        * disable and enable the Editor&#39;s toolbar based on the noedit state.</span>
<span class="cm">        * @return Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_isNonEditable</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;allowNoEdit&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;html&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="kd">var</span> <span class="nx">path</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDomPath</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="p">(</span><span class="nx">path</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">);</span> <span class="nx">i</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NOEDIT</span><span class="p">))</span> <span class="p">{</span>
                        <span class="c1">//if (this.toolbar.get(&#39;disabled&#39;) === false) {</span>
                        <span class="c1">//    this.toolbar.set(&#39;disabled&#39;, true);</span>
                        <span class="c1">//}</span>
                        <span class="k">try</span> <span class="p">{</span>
                             <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;enableObjectResizing&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="s1">&#39;false&#39;</span><span class="p">);</span>
                        <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{}</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                        <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;CLASS_NOEDIT found in DOM Path, stopping event&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">//if (this.toolbar.get(&#39;disabled&#39;) === true) {</span>
                    <span class="c1">//Should only happen once..</span>
                    <span class="c1">//this.toolbar.set(&#39;disabled&#39;, false);</span>
                    <span class="k">try</span> <span class="p">{</span>
                         <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;enableObjectResizing&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="s1">&#39;true&#39;</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e2</span><span class="p">)</span> <span class="p">{}</span>
                <span class="c1">//}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _setCurrentEvent</span>
<span class="cm">        * @param {Event} ev The event to cache</span>
<span class="cm">        * @description Sets the current event property</span>
<span class="cm">        */</span>
        <span class="nx">_setCurrentEvent</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="nx">ev</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleClick</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles all click events inside the iFrame document.</span>
<span class="cm">        */</span>
        <span class="nx">_handleClick</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeEditorClick&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeEditorClick&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isNonEditable</span><span class="p">(</span><span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setCurrentEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">tar</span> <span class="o">=</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorClick&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorClick&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleMouseUp</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles all mouseup events inside the iFrame document.</span>
<span class="cm">        */</span>
        <span class="nx">_handleMouseUp</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeEditorMouseUp&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeEditorMouseUp&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isNonEditable</span><span class="p">(</span><span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="c1">//Don&#39;t set current event for mouseup.</span>
            <span class="c1">//It get&#39;s fired after a menu is closed and gives up a bogus event to work with</span>
            <span class="c1">//this._setCurrentEvent(ev);</span>
            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                <span class="cm">/*</span>
<span class="cm">                * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..</span>
<span class="cm">                * @browser Opera</span>
<span class="cm">                * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.</span>
<span class="cm">                */</span>
                <span class="kd">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">operaEvent</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">clearTimeout</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">operaEvent</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">operaEvent</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_handleDoubleClick</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">operaEvent</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                            <span class="nx">self</span><span class="p">.</span><span class="nx">operaEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                        <span class="p">},</span> <span class="mi">700</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">//This will stop Safari from selecting the entire document if you select all the text in the editor</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorMouseUp&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorMouseUp&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleMouseDown</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles all mousedown events inside the iFrame document.</span>
<span class="cm">        */</span>
        <span class="nx">_handleMouseDown</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeEditorMouseDown&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeEditorMouseDown&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isNonEditable</span><span class="p">(</span><span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setCurrentEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">_sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">_sel</span><span class="p">.</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">_sel</span><span class="p">.</span><span class="nx">collapseToStart</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_lastImage</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_lastImage</span><span class="p">,</span> <span class="s1">&#39;selected&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_lastImage</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;selected&#39;</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_lastImage</span> <span class="o">=</span> <span class="nx">sel</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorMouseDown&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorMouseDown&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleDoubleClick</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles all doubleclick events inside the iFrame document.</span>
<span class="cm">        */</span>
        <span class="nx">_handleDoubleClick</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeEditorDoubleClick&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeEditorDoubleClick&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isNonEditable</span><span class="p">(</span><span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setCurrentEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">sel</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;insertimageClick&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;insertimageClick&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span> <span class="p">});</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">))</span> <span class="p">{</span> <span class="c1">//Handle elements inside an a</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">sel</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;createlinkClick&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;createlinkClick&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span> <span class="p">});</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorDoubleClick&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorDoubleClick&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleKeyUp</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles all keyup events inside the iFrame document.</span>
<span class="cm">        */</span>
        <span class="nx">_handleKeyUp</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeEditorKeyUp&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeEditorKeyUp&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isNonEditable</span><span class="p">(</span><span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_storeUndo</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setCurrentEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="k">switch</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">SELECT_ALL</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">SELECT_ALL</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="k">case</span> <span class="mi">32</span><span class="o">:</span> <span class="c1">//Space Bar</span>
                <span class="k">case</span> <span class="mi">35</span><span class="o">:</span> <span class="c1">//End</span>
                <span class="k">case</span> <span class="mi">36</span><span class="o">:</span> <span class="c1">//Home</span>
                <span class="k">case</span> <span class="mi">37</span><span class="o">:</span> <span class="c1">//Left Arrow</span>
                <span class="k">case</span> <span class="mi">38</span><span class="o">:</span> <span class="c1">//Up Arrow</span>
                <span class="k">case</span> <span class="mi">39</span><span class="o">:</span> <span class="c1">//Right Arrow</span>
                <span class="k">case</span> <span class="mi">40</span><span class="o">:</span> <span class="c1">//Down Arrow</span>
                <span class="k">case</span> <span class="mi">46</span><span class="o">:</span> <span class="c1">//Forward Delete</span>
                <span class="k">case</span> <span class="mi">8</span><span class="o">:</span> <span class="c1">//Delete</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">CLOSE_WINDOW</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span> <span class="c1">//W key if window is open</span>
                    <span class="k">if</span> <span class="p">((</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">CLOSE_WINDOW</span><span class="p">.</span><span class="nx">key</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">CLOSE_WINDOW</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeTimer</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">clearTimeout</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeTimer</span><span class="p">);</span>
                            <span class="p">}</span>
                            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeTimer</span> <span class="o">=</span> <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                                <span class="nx">self</span><span class="p">.</span><span class="nx">_nodeChangeTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                                <span class="nx">self</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                            <span class="p">},</span> <span class="mi">100</span><span class="p">);</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                        <span class="p">}</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">editorDirty</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorKeyUp&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorKeyUp&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleKeyPress</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles all keypress events inside the iFrame document.</span>
<span class="cm">        */</span>
        <span class="nx">_handleKeyPress</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeEditorKeyPress&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeEditorKeyPress&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;allowNoEdit&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//if (ev &amp;&amp; ev.keyCode &amp;&amp; ((ev.keyCode == 46) || ev.keyCode == 63272)) {</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="mi">63272</span><span class="p">))</span> <span class="p">{</span>
                    <span class="c1">//Forward delete key</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;allowNoEdit is set, forward delete key has been disabled&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isNonEditable</span><span class="p">(</span><span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setCurrentEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_storeUndo</span><span class="p">();</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">===</span> <span class="mi">13</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;inserthtml&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">);</span>
                        <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="mi">122</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">metaKey</span><span class="p">))</span> <span class="p">{</span>
                        <span class="c1">//This is CMD + z (for undo)</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;We are in an LI and we found CMD + z, stopping the event&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                            <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_listFix</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_fixListDupIds</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorKeyPress&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorKeyPress&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleKeyDown</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles all keydown events inside the iFrame document.</span>
<span class="cm">        */</span>
        <span class="nx">_handleKeyDown</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeEditorKeyDown&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeEditorKeyDown&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">_range</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isNonEditable</span><span class="p">(</span><span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setCurrentEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">action</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">value</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

            <span class="c1">//YAHOO.log(&#39;keyCode: &#39; + ev.keyCode, &#39;info&#39;, &#39;SimpleEditor&#39;);</span>

            <span class="k">switch</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">FOCUS_TOOLBAR</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">FOCUS_TOOLBAR</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;h2&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">h</span> <span class="o">&amp;&amp;</span> <span class="nx">h</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">h</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">FOCUS_AFTER</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="c1">//Focus After Element - Esc</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">afterElement</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
                    <span class="p">}</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                    <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="c1">//case 76: //L</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">CREATE_LINK</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span> <span class="c1">//L</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">CREATE_LINK</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">makeLink</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;limitCommands&#39;</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;createlink&#39;</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Toolbar Button for (createlink) was not found, skipping exec.&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                                    <span class="nx">makeLink</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">makeLink</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;createlink&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;createlinkClick&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;createlinkClick&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span> <span class="p">});</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
                                <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="c1">//case 90: //Z</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">UNDO</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">REDO</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">REDO</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;redo&#39;</span><span class="p">;</span>
                        <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">UNDO</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;undo&#39;</span><span class="p">;</span>
                        <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="c1">//case 66: //B</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">BOLD</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">BOLD</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;bold&#39;</span><span class="p">;</span>
                        <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">FONT_SIZE_UP</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">FONT_SIZE_DOWN</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                    <span class="kd">var</span> <span class="nx">uk</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nx">dk</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">FONT_SIZE_UP</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">uk</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">FONT_SIZE_DOWN</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">dk</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">uk</span> <span class="o">||</span> <span class="nx">dk</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">fs_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;fontsize&#39;</span><span class="p">),</span>
                            <span class="nx">label</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">fs_button</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">),</span> <span class="mi">10</span><span class="p">),</span>
                            <span class="nx">newValue</span> <span class="o">=</span> <span class="p">(</span><span class="nx">label</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>

                        <span class="k">if</span> <span class="p">(</span><span class="nx">dk</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">newValue</span> <span class="o">=</span> <span class="p">(</span><span class="nx">label</span> <span class="o">-</span> <span class="mi">1</span><span class="p">);</span>
                        <span class="p">}</span>

                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;fontsize&#39;</span><span class="p">;</span>
                        <span class="nx">value</span> <span class="o">=</span> <span class="nx">newValue</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">;</span>
                        <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="c1">//case 73: //I</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">ITALIC</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">ITALIC</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;italic&#39;</span><span class="p">;</span>
                        <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="c1">//case 85: //U</span>
                <span class="k">case</span> <span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">UNDERLINE</span><span class="p">.</span><span class="nx">key</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_checkKey</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_keyMap</span><span class="p">.</span><span class="nx">UNDERLINE</span><span class="p">,</span> <span class="nx">ev</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;underline&#39;</span><span class="p">;</span>
                        <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="k">case</span> <span class="mi">9</span><span class="o">:</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">//Insert a tab in Internet Explorer</span>
                        <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">();</span>
                        <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">_range</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">_range</span><span class="p">.</span><span class="nx">pasteHTML</span><span class="p">(</span><span class="s1">&#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;</span><span class="p">);</span>
                                <span class="nx">_range</span><span class="p">.</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                                <span class="nx">_range</span><span class="p">.</span><span class="nx">select</span><span class="p">();</span>
                            <span class="p">}</span>
                            <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">//Firefox 3 code</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">gecko</span> <span class="o">&gt;</span> <span class="mf">1.8</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;outdent&#39;</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;indent&#39;</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                            <span class="p">}</span>
                            
                        <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;inserthtml&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;</span><span class="p">);</span>
                        <span class="p">}</span>
                        <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="k">case</span> <span class="mi">13</span><span class="o">:</span>
                    <span class="kd">var</span> <span class="nx">p</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;ptags&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">ev</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">gecko</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;p&#39;</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="nx">p</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">);</span>
                                    <span class="nx">p</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">;</span>
                                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">insertAfter</span><span class="p">(</span><span class="nx">p</span><span class="p">,</span> <span class="nx">tar</span><span class="p">);</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">p</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">);</span>
                                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;insertparagraph&#39;</span><span class="p">,</span> <span class="kc">null</span><span class="p">);</span>
                                    <span class="kd">var</span> <span class="nx">ps</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">);</span>
                                    <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">ps</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">if</span> <span class="p">(</span><span class="nx">ps</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;_moz_dirty&#39;</span><span class="p">)</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                                            <span class="nx">p</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">);</span>
                                            <span class="nx">p</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">;</span>
                                            <span class="nx">Dom</span><span class="p">.</span><span class="nx">insertAfter</span><span class="p">(</span><span class="nx">p</span><span class="p">,</span> <span class="nx">ps</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                                            <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">p</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">);</span>
                                            <span class="nx">ps</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">removeAttribute</span><span class="p">(</span><span class="s1">&#39;_moz_dirty&#39;</span><span class="p">);</span>
                                        <span class="p">}</span>
                                    <span class="p">}</span>
                                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Something went wrong with paragraphs, please file a bug!!&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                                    <span class="nx">doExec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;insertparagraph&#39;</span><span class="p">;</span>
                                <span class="p">}</span>
                                <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;insertparagraph&#39;</span><span class="p">,</span> <span class="kc">null</span><span class="p">);</span>
                                <span class="kd">var</span> <span class="nx">divs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
                                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">divs</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">divs</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;yui-wk-div&#39;</span><span class="p">))</span> <span class="p">{</span>
                                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">divs</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;yui-wk-p&#39;</span><span class="p">);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit4</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;insertlinebreak&#39;</span><span class="p">);</span>
                                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;inserthtml&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;var id=&quot;yui-br&quot;&gt;&lt;/var&gt;&#39;</span><span class="p">);</span>
                                    <span class="kd">var</span> <span class="nx">holder</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">&#39;yui-br&#39;</span><span class="p">),</span>
                                        <span class="nx">br</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;br&#39;</span><span class="p">),</span>
                                        <span class="nx">caret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">);</span>

                                    <span class="nx">holder</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">br</span><span class="p">,</span> <span class="nx">holder</span><span class="p">);</span>
                                    <span class="nx">caret</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-non&#39;</span><span class="p">;</span>
                                    <span class="nx">caret</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">;</span>
                                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">insertAfter</span><span class="p">(</span><span class="nx">caret</span><span class="p">,</span> <span class="nx">br</span><span class="p">);</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">caret</span><span class="p">);</span>
                                <span class="p">}</span>
                                <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Stopping P tags&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                            <span class="c1">//Insert a &lt;br&gt; instead of a &lt;p&gt;&lt;/p&gt; in Internet Explorer</span>
                            <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">();</span>
                            <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="nx">_range</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="nx">_range</span><span class="p">.</span><span class="nx">pasteHTML</span><span class="p">(</span><span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">);</span>
                                    <span class="nx">_range</span><span class="p">.</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                                    <span class="nx">_range</span><span class="p">.</span><span class="nx">select</span><span class="p">();</span>
                                <span class="p">}</span>
                                <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="k">break</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_listFix</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">doExec</span> <span class="o">&amp;&amp;</span> <span class="nx">action</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="nx">action</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_storeUndo</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;editorKeyDown&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;editorKeyDown&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">ev</span><span class="o">:</span> <span class="nx">ev</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _fixListRunning</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        * @description Keeps more than one _fixListDupIds from running at the same time.</span>
<span class="cm">        */</span>
        <span class="nx">_fixListRunning</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _fixListDupIds</span>
<span class="cm">        * @description Some browsers will duplicate the id of an LI when created in designMode.</span>
<span class="cm">        * This method will fix the duplicate id issue. However it will only preserve the first element </span>
<span class="cm">        * in the document list with the unique id. </span>
<span class="cm">        */</span>
        <span class="nx">_fixListDupIds</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_fixListRunning</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">())</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_fixListRunning</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="kd">var</span> <span class="nx">lis</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">),</span>
                    <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">ids</span> <span class="o">=</span> <span class="p">{};</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">lis</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">lis</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">ids</span><span class="p">[</span><span class="nx">lis</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span><span class="p">])</span> <span class="p">{</span>
                            <span class="nx">lis</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="nx">ids</span><span class="p">[</span><span class="nx">lis</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span><span class="p">]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_fixListRunning</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _listFix</span>
<span class="cm">        * @param {Event} ev The event we are working on.</span>
<span class="cm">        * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items.</span>
<span class="cm">        */</span>
        <span class="nx">_listFix</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">//YAHOO.log(&#39;Lists Fix (&#39; + ev.keyCode + &#39;)&#39;, &#39;info&#39;, &#39;SimpleEditor&#39;);</span>
            <span class="kd">var</span> <span class="nx">testLi</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">par</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">preContent</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nx">range</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="c1">//Enter Key</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="mi">13</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span> <span class="s1">&#39;li&#39;</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">tar</span><span class="p">.</span><span class="nx">previousSibling</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">tar</span><span class="p">.</span><span class="nx">firstChild</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tar</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">length</span> <span class="o">==</span> <span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">tar</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">//Shift + Tab Key</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="mi">25</span><span class="p">))</span> <span class="o">||</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span> <span class="o">||</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="mi">9</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">))))</span> <span class="p">{</span>
                <span class="nx">testLi</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">testLi</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">);</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;We have a SHIFT tab in an LI, reverse it..&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;ul&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;ol&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;We have a double parent, move up a level&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                        <span class="nx">par</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;ul&#39;</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">par</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">par</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;ol&#39;</span><span class="p">);</span>
                        <span class="p">}</span>
                        <span class="c1">//YAHOO.log(par.previousSibling + &#39; :: &#39; + par.previousSibling.innerHTML);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">par</span><span class="p">.</span><span class="nx">previousSibling</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">par</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">testLi</span><span class="p">);</span>
                            <span class="nx">par</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="nx">par</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">);</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">createTextRange</span><span class="p">();</span>
                                <span class="nx">range</span><span class="p">.</span><span class="nx">moveToElementText</span><span class="p">(</span><span class="nx">testLi</span><span class="p">);</span>
                                <span class="nx">range</span><span class="p">.</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                                <span class="nx">range</span><span class="p">.</span><span class="nx">select</span><span class="p">();</span>
                            <span class="p">}</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">testLi</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">);</span>
                            <span class="p">}</span>
                            <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">//Tab Key</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="nx">ev</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="mi">9</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="nx">ev</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">)))</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;List Fix - Tab&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">preLi</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">preLi</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">preContent</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">preLi</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">).</span><span class="nx">innerHTML</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="c1">//YAHOO.log(&#39;preLI: &#39; + preLi.tagName + &#39; :: &#39; + preLi.innerHTML);</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;inserttext&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="s1">&#39;\t&#39;</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="nx">testLi</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;We have a tab in an LI&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="nx">par</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">testLi</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">);</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;parLI: &#39;</span> <span class="o">+</span> <span class="nx">par</span><span class="p">.</span><span class="nx">tagName</span> <span class="o">+</span> <span class="s1">&#39; :: &#39;</span> <span class="o">+</span> <span class="nx">par</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">newUl</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">par</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">());</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">span</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="s1">&#39;Apple-tab-span&#39;</span><span class="p">,</span> <span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="nx">par</span><span class="p">);</span>
                        <span class="c1">//Remove the span element that Safari puts in</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">span</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">{</span>
                            <span class="nx">par</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">span</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                            <span class="nx">par</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">trim</span><span class="p">(</span><span class="nx">par</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">);</span>
                            <span class="c1">//Put the HTML from the LI into this new LI</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">preContent</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">par</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;yui-non&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">preContent</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&amp;nbsp;&#39;</span><span class="p">;</span>
                            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                <span class="nx">par</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;yui-non&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&#39;</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">preContent</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">par</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">preContent</span> <span class="o">+</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">;</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">par</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>

                    <span class="nx">par</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">newUl</span><span class="p">,</span> <span class="nx">par</span><span class="p">);</span>
                    <span class="nx">newUl</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">par</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">setBaseAndExtent</span><span class="p">(</span><span class="nx">par</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="nx">par</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">,</span> <span class="nx">par</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">innerText</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">par</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;list-item&#39;</span><span class="p">;</span>
                            <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                                <span class="nx">par</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;block&#39;</span><span class="p">;</span>
                            <span class="p">},</span> <span class="mi">1</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">createTextRange</span><span class="p">();</span>
                        <span class="nx">range</span><span class="p">.</span><span class="nx">moveToElementText</span><span class="p">(</span><span class="nx">par</span><span class="p">);</span>
                        <span class="nx">range</span><span class="p">.</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                        <span class="nx">range</span><span class="p">.</span><span class="nx">select</span><span class="p">();</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">par</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method nodeChange</span>
<span class="cm">        * @param {Boolean} force Optional paramenter to skip the threshold counter</span>
<span class="cm">        * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.</span>
<span class="cm">        */</span>
        <span class="nx">nodeChange</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">force</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">NCself</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_storeUndo</span><span class="p">();</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;nodeChangeDelay&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeDelayTimer</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="nx">NCself</span><span class="p">.</span><span class="nx">_nodeChangeDelayTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="nx">NCself</span><span class="p">.</span><span class="nx">_nodeChange</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">NCself</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
                <span class="p">},</span> <span class="mi">0</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_nodeChange</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _nodeChange</span>
<span class="cm">        * @param {Boolean} force Optional paramenter to skip the threshold counter</span>
<span class="cm">        * @description Fired from nodeChange in a setTimeout.</span>
<span class="cm">        */</span>
        <span class="nx">_nodeChange</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">force</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">threshold</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;nodeChangeThreshold&#39;</span><span class="p">),</span> <span class="mi">10</span><span class="p">),</span>
                <span class="nx">thisNodeChange</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">round</span><span class="p">(</span><span class="k">new</span> <span class="nb">Date</span><span class="p">().</span><span class="nx">getTime</span><span class="p">()</span> <span class="o">/</span> <span class="mi">1000</span><span class="p">),</span>
                <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">force</span> <span class="o">===</span> <span class="kc">true</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_lastNodeChange</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="p">}</span>
            
            <span class="k">if</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">_lastNodeChange</span> <span class="o">+</span> <span class="nx">threshold</span><span class="p">)</span> <span class="o">&lt;</span> <span class="nx">thisNodeChange</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_fixNodesTimer</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_fixNodesTimer</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="nx">self</span><span class="p">.</span><span class="nx">_fixNodes</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                        <span class="nx">self</span><span class="p">.</span><span class="nx">_fixNodesTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="p">},</span> <span class="mi">0</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_lastNodeChange</span> <span class="o">=</span> <span class="nx">thisNodeChange</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_lastNodeChangeEvent</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">.</span><span class="nx">type</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{}</span>
            <span class="p">}</span>

            <span class="kd">var</span> <span class="nx">beforeNodeChange</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeNodeChange&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeNodeChange&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">beforeNodeChange</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;dompath&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_writeDomPath</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                <span class="p">},</span> <span class="mi">0</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="c1">//Check to see if we are disabled before continuing</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">STOP_NODE_CHANGE</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">//Reset this var for next action</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">STOP_NODE_CHANGE</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">(),</span>
                        <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">(),</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span>
                        <span class="nx">fn_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;fontname&#39;</span><span class="p">),</span>
                        <span class="nx">fs_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;fontsize&#39;</span><span class="p">),</span>
                        <span class="nx">undo_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;undo&#39;</span><span class="p">),</span>
                        <span class="nx">redo_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;redo&#39;</span><span class="p">);</span>

                    <span class="c1">//Handle updating the toolbar with active buttons</span>
                    <span class="kd">var</span> <span class="nx">_ex</span> <span class="o">=</span> <span class="p">{};</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">_ex</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span><span class="p">.</span><span class="nx">id</span><span class="p">]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="c1">//this._lastButton = null;</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">fn_button</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">_ex</span><span class="p">[</span><span class="nx">fn_button</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">fs_button</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">_ex</span><span class="p">[</span><span class="nx">fs_button</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">redo_button</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">delete</span> <span class="nx">_ex</span><span class="p">[</span><span class="nx">redo_button</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)];</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">resetAllButtons</span><span class="p">(</span><span class="nx">_ex</span><span class="p">);</span>

                    <span class="c1">//Handle disabled buttons</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">d</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">d</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span><span class="p">[</span><span class="nx">d</span><span class="p">]);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">_button</span> <span class="o">&amp;&amp;</span> <span class="nx">_button</span><span class="p">.</span><span class="nx">get</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">_button</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)</span> <span class="o">===</span> <span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span><span class="p">.</span><span class="nx">id</span><span class="p">))</span> <span class="p">{</span>
                                <span class="c1">//Skip</span>
                            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="k">switch</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span><span class="p">[</span><span class="nx">d</span><span class="p">])</span> <span class="p">{</span>
                                        <span class="k">case</span> <span class="s1">&#39;fontname&#39;</span><span class="o">:</span>
                                        <span class="k">case</span> <span class="s1">&#39;fontsize&#39;</span><span class="o">:</span>
                                            <span class="k">break</span><span class="p">;</span>
                                        <span class="k">default</span><span class="o">:</span>
                                            <span class="c1">//No Selection - disable</span>
                                            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">disableButton</span><span class="p">(</span><span class="nx">_button</span><span class="p">);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_alwaysDisabled</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span><span class="p">[</span><span class="nx">d</span><span class="p">]])</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="nx">_button</span><span class="p">);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_alwaysEnabled</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span><span class="p">[</span><span class="nx">d</span><span class="p">]])</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">deselectButton</span><span class="p">(</span><span class="nx">_button</span><span class="p">);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="kd">var</span> <span class="nx">path</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDomPath</span><span class="p">();</span>
                    <span class="kd">var</span> <span class="nx">tag</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">path</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">tag</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">).</span><span class="nx">toLowerCase</span><span class="p">();</span>
                        <span class="p">}</span>
                        <span class="nx">cmd</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_tag2cmd</span><span class="p">[</span><span class="nx">tag</span><span class="p">];</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">cmd</span> <span class="o">===</span> <span class="kc">undefined</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">cmd</span> <span class="o">=</span> <span class="p">[];</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">cmd</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="nx">cmd</span><span class="p">];</span>
                        <span class="p">}</span>

                        <span class="c1">//Bold and Italic styles</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontWeight</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;bold&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">cmd</span><span class="p">[</span><span class="nx">cmd</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;bold&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontStyle</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;italic&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">cmd</span><span class="p">[</span><span class="nx">cmd</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;italic&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">textDecoration</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;underline&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">cmd</span><span class="p">[</span><span class="nx">cmd</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;underline&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">textDecoration</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;line-through&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">cmd</span><span class="p">[</span><span class="nx">cmd</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;strikethrough&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">cmd</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">cmd</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">selectButton</span><span class="p">(</span><span class="nx">cmd</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="nx">cmd</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="c1">//Handle Alignment</span>
                        <span class="k">switch</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">textAlign</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">())</span> <span class="p">{</span>
                            <span class="k">case</span> <span class="s1">&#39;left&#39;</span><span class="o">:</span>
                            <span class="k">case</span> <span class="s1">&#39;right&#39;</span><span class="o">:</span>
                            <span class="k">case</span> <span class="s1">&#39;center&#39;</span><span class="o">:</span>
                            <span class="k">case</span> <span class="s1">&#39;justify&#39;</span><span class="o">:</span>
                                <span class="kd">var</span> <span class="nx">alignType</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">textAlign</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
                                <span class="k">if</span> <span class="p">(</span><span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">textAlign</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;justify&#39;</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="nx">alignType</span> <span class="o">=</span> <span class="s1">&#39;full&#39;</span><span class="p">;</span>
                                <span class="p">}</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">selectButton</span><span class="p">(</span><span class="s1">&#39;justify&#39;</span> <span class="o">+</span> <span class="nx">alignType</span><span class="p">);</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="s1">&#39;justify&#39;</span> <span class="o">+</span> <span class="nx">alignType</span><span class="p">);</span>
                                <span class="k">break</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">//After for loop</span>

                    <span class="c1">//Reset Font Family and Size to the inital configs</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">fn_button</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">family</span> <span class="o">=</span> <span class="nx">fn_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">label</span><span class="p">.</span><span class="nx">_initialConfig</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span>
                        <span class="nx">fn_button</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-fontname-&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_cleanClassName</span><span class="p">(</span><span class="nx">family</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">family</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_updateMenuChecked</span><span class="p">(</span><span class="s1">&#39;fontname&#39;</span><span class="p">,</span> <span class="nx">family</span><span class="p">);</span>
                    <span class="p">}</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">fs_button</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">fs_button</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">,</span> <span class="nx">fs_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">label</span><span class="p">.</span><span class="nx">_initialConfig</span><span class="p">.</span><span class="nx">value</span><span class="p">);</span>
                    <span class="p">}</span>

                    <span class="kd">var</span> <span class="nx">hd_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;heading&#39;</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">hd_button</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">hd_button</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">,</span> <span class="nx">hd_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">label</span><span class="p">.</span><span class="nx">_initialConfig</span><span class="p">.</span><span class="nx">value</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_updateMenuChecked</span><span class="p">(</span><span class="s1">&#39;heading&#39;</span><span class="p">,</span> <span class="s1">&#39;none&#39;</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="kd">var</span> <span class="nx">img_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;insertimage&#39;</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">img_button</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">.</span><span class="nx">name</span> <span class="o">==</span> <span class="s1">&#39;insertimage&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">disableButton</span><span class="p">(</span><span class="nx">img_button</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">deselectButton</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span><span class="p">.</span><span class="nx">id</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_undoNodeChange</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;afterNodeChange&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterNodeChange&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _updateMenuChecked</span>
<span class="cm">        * @param {Object} button The command identifier of the button you want to check</span>
<span class="cm">        * @param {String} value The value of the menu item you want to check</span>
<span class="cm">        * @param {&lt;a href=&quot;YAHOO.widget.Toolbar.html&quot;&gt;YAHOO.widget.Toolbar&lt;/a&gt;} The Toolbar instance the button belongs to (defaults to this.toolbar) </span>
<span class="cm">        * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on.</span>
<span class="cm">        */</span>
        <span class="nx">_updateMenuChecked</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">button</span><span class="p">,</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">tbar</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">tbar</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">tbar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">_button</span> <span class="o">=</span> <span class="nx">tbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="nx">button</span><span class="p">);</span>
            <span class="nx">_button</span><span class="p">.</span><span class="nx">checkValue</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleToolbarClick</span>
<span class="cm">        * @param {Event} ev The event that triggered the button click</span>
<span class="cm">        * @description This is an event handler attached to the Toolbar&#39;s buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button.</span>
<span class="cm">        */</span>
        <span class="nx">_handleToolbarClick</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">ev</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">ev</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">menucmd</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">value</span> <span class="o">=</span> <span class="nx">cmd</span><span class="p">;</span>
                <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">ev</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">menucmd</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span> <span class="o">=</span> <span class="nx">ev</span><span class="p">.</span><span class="nx">button</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">STOP_EXEC_COMMAND</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;execCommand skipped because we found the STOP_EXEC_COMMAND flag set to true&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;NOEXEC::execCommand::(&#39;</span> <span class="o">+</span> <span class="nx">cmd</span> <span class="o">+</span> <span class="s1">&#39;), (&#39;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">STOP_EXEC_COMMAND</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="nx">cmd</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                     <span class="kd">var</span> <span class="nx">Fself</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                     <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                         <span class="nx">Fself</span><span class="p">.</span><span class="nx">focus</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">Fself</span><span class="p">);</span>
                     <span class="p">},</span> <span class="mi">5</span><span class="p">);</span>
                 <span class="p">}</span>
            <span class="p">}</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _setupAfterElement</span>
<span class="cm">        * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.</span>
<span class="cm">        */</span>
        <span class="nx">_setupAfterElement</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">beforeElement</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">beforeElement</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;h2&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">beforeElement</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-editor-skipheader&#39;</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">beforeElement</span><span class="p">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="s1">&#39;-1&#39;</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">beforeElement</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">STR_BEFORE_EDITOR</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;firstChild&#39;</span><span class="p">).</span><span class="nx">insertBefore</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">beforeElement</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;nextSibling&#39;</span><span class="p">));</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">afterElement</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">afterElement</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;h2&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">afterElement</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-editor-skipheader&#39;</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">afterElement</span><span class="p">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="s1">&#39;-1&#39;</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">afterElement</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">STR_LEAVE_EDITOR</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;firstChild&#39;</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">afterElement</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _disableEditor</span>
<span class="cm">        * @param {Boolean} disabled Pass true to disable, false to enable</span>
<span class="cm">        * @description Creates a mask to place over the Editor.</span>
<span class="cm">        */</span>
        <span class="nx">_disableEditor</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">iframe</span><span class="p">,</span> <span class="nx">par</span><span class="p">,</span> <span class="nx">html</span><span class="p">,</span> <span class="nx">height</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;disabled_iframe&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">iframe</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createIframe</span><span class="p">();</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">,</span> <span class="s1">&#39;disabled_&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">));</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="s1">&#39;100%&#39;</span><span class="p">);</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;display&#39;</span><span class="p">,</span> <span class="s1">&#39;none&#39;</span><span class="p">);</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;visible&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled_iframe&#39;</span><span class="p">,</span> <span class="nx">iframe</span><span class="p">);</span>
                <span class="nx">par</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">);</span>
                <span class="nx">par</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">iframe</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">));</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">iframe</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">iframe</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;disabled_iframe&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">);</span>

                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                <span class="p">}</span>

                <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getEditorHTML</span><span class="p">();</span>
                <span class="nx">height</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;offsetHeight&#39;</span><span class="p">);</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;top&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;hidden&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;absolute&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;top&#39;</span><span class="p">,</span> <span class="s1">&#39;-99999px&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;-99999px&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">,</span> <span class="nx">iframe</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_setInitialContent</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_mask</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_mask</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;DIV&#39;</span><span class="p">);</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_mask</span><span class="p">,</span> <span class="s1">&#39;yui-editor-masked&#39;</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_mask</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">height</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_mask</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;editorContentReloaded&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">_rteLoaded</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">setEditorHTML</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>
                    <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;display&#39;</span><span class="p">,</span> <span class="s1">&#39;block&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">(</span><span class="s1">&#39;editorContentReloaded&#39;</span><span class="p">);</span>
                <span class="p">});</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_mask</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_mask</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_mask</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_mask</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;hidden&#39;</span><span class="p">);</span>
                    <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;absolute&#39;</span><span class="p">);</span>
                    <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;top&#39;</span><span class="p">,</span> <span class="s1">&#39;-99999px&#39;</span><span class="p">);</span>
                    <span class="nx">iframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;-99999px&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;top&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_orgIframe</span><span class="p">);</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
                    <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                    <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="nx">self</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                    <span class="p">},</span> <span class="mi">100</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @property SEP_DOMPATH</span>
<span class="cm">        * @description The value to place in between the Dom path items</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">SEP_DOMPATH</span><span class="o">:</span> <span class="s1">&#39;&lt;&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property STR_LEAVE_EDITOR</span>
<span class="cm">        * @description The accessibility string for the element after the iFrame</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">STR_LEAVE_EDITOR</span><span class="o">:</span> <span class="s1">&#39;You have left the Rich Text Editor.&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property STR_BEFORE_EDITOR</span>
<span class="cm">        * @description The accessibility string for the element before the iFrame</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">STR_BEFORE_EDITOR</span><span class="o">:</span> <span class="s1">&#39;This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Shift + Escape to place focus on the toolbar and navigate between options with your arrow keys. To exit this text editor use the Escape key and continue tabbing. &lt;h4&gt;Common formatting keyboard shortcuts:&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Control Shift B sets text to bold&lt;/li&gt; &lt;li&gt;Control Shift I sets text to italic&lt;/li&gt; &lt;li&gt;Control Shift U underlines text&lt;/li&gt; &lt;li&gt;Control Shift L adds an HTML link&lt;/li&gt;&lt;/ul&gt;&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property STR_TITLE</span>
<span class="cm">        * @description The Title of the HTML document that is created in the iFrame</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">STR_TITLE</span><span class="o">:</span> <span class="s1">&#39;Rich Text Area.&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property STR_IMAGE_HERE</span>
<span class="cm">        * @description The text to place in the URL textbox when using the blankimage.</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">STR_IMAGE_HERE</span><span class="o">:</span> <span class="s1">&#39;Image URL Here&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @property STR_IMAGE_URL</span>
<span class="cm">        * @description The label string for Image URL</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">STR_IMAGE_URL</span><span class="o">:</span> <span class="s1">&#39;Image URL&#39;</span><span class="p">,</span>        
        <span class="cm">/**</span>
<span class="cm">        * @property STR_LINK_URL</span>
<span class="cm">        * @description The label string for the Link URL.</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">STR_LINK_URL</span><span class="o">:</span> <span class="s1">&#39;Link URL&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @property STOP_EXEC_COMMAND</span>
<span class="cm">        * @description Set to true when you want the default execCommand function to not process anything</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">STOP_EXEC_COMMAND</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @property STOP_NODE_CHANGE</span>
<span class="cm">        * @description Set to true when you want the default nodeChange function to not process anything</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">STOP_NODE_CHANGE</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @property CLASS_NOEDIT</span>
<span class="cm">        * @description CSS class applied to elements that are not editable.</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">CLASS_NOEDIT</span><span class="o">:</span> <span class="s1">&#39;yui-noedit&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @property CLASS_CONTAINER</span>
<span class="cm">        * @description Default CSS class to apply to the editors container element</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">CLASS_CONTAINER</span><span class="o">:</span> <span class="s1">&#39;yui-editor-container&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @property CLASS_EDITABLE</span>
<span class="cm">        * @description Default CSS class to apply to the editors iframe element</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">CLASS_EDITABLE</span><span class="o">:</span> <span class="s1">&#39;yui-editor-editable&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @property CLASS_EDITABLE_CONT</span>
<span class="cm">        * @description Default CSS class to apply to the editors iframe&#39;s parent element</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">CLASS_EDITABLE_CONT</span><span class="o">:</span> <span class="s1">&#39;yui-editor-editable-container&#39;</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @property CLASS_PREFIX</span>
<span class="cm">        * @description Default prefix for dynamically created class names</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">CLASS_PREFIX</span><span class="o">:</span> <span class="s1">&#39;yui-editor&#39;</span><span class="p">,</span>
        <span class="cm">/** </span>
<span class="cm">        * @property browser</span>
<span class="cm">        * @description Standard browser detection</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">browser</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">br</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ua</span><span class="p">;</span>
            <span class="c1">//Check for webkit3</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">br</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&gt;=</span> <span class="mi">420</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">br</span><span class="p">.</span><span class="nx">webkit3</span> <span class="o">=</span> <span class="nx">br</span><span class="p">.</span><span class="nx">webkit</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">br</span><span class="p">.</span><span class="nx">webkit3</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">br</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&gt;=</span> <span class="mi">530</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">br</span><span class="p">.</span><span class="nx">webkit4</span> <span class="o">=</span> <span class="nx">br</span><span class="p">.</span><span class="nx">webkit</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">br</span><span class="p">.</span><span class="nx">webkit4</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="nx">br</span><span class="p">.</span><span class="nx">mac</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="c1">//Check for Mac</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">navigator</span><span class="p">.</span><span class="nx">userAgent</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;Macintosh&#39;</span><span class="p">)</span> <span class="o">!==</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">br</span><span class="p">.</span><span class="nx">mac</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">return</span> <span class="nx">br</span><span class="p">;</span>
        <span class="p">}(),</span>
        <span class="cm">/** </span>
<span class="cm">        * @method init</span>
<span class="cm">        * @description The Editor class&#39; initialization method</span>
<span class="cm">        */</span>
        <span class="nx">init</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">,</span> <span class="nx">p_oAttributes</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;init&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_defaultToolbar</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_defaultToolbar</span> <span class="o">=</span> <span class="p">{</span>
                    <span class="nx">collapse</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                    <span class="nx">titlebar</span><span class="o">:</span> <span class="s1">&#39;Text Editing Tools&#39;</span><span class="p">,</span>
                    <span class="nx">draggable</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
                    <span class="nx">buttons</span><span class="o">:</span> <span class="p">[</span>
                        <span class="p">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;fontstyle&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Font Name and Size&#39;</span><span class="p">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="p">[</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;select&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Arial&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;fontname&#39;</span><span class="p">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                                    <span class="nx">menu</span><span class="o">:</span> <span class="p">[</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Arial&#39;</span><span class="p">,</span> <span class="nx">checked</span><span class="o">:</span> <span class="kc">true</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Arial Black&#39;</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Comic Sans MS&#39;</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Courier New&#39;</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Lucida Console&#39;</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Tahoma&#39;</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Times New Roman&#39;</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Trebuchet MS&#39;</span> <span class="p">},</span>
                                        <span class="p">{</span> <span class="nx">text</span><span class="o">:</span> <span class="s1">&#39;Verdana&#39;</span> <span class="p">}</span>
                                    <span class="p">]</span>
                                <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;spin&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;13&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;fontsize&#39;</span><span class="p">,</span> <span class="nx">range</span><span class="o">:</span> <span class="p">[</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">75</span> <span class="p">],</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="p">}</span>
                            <span class="p">]</span>
                        <span class="p">},</span>
                        <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="p">},</span>
                        <span class="p">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;textstyle&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Font Style&#39;</span><span class="p">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="p">[</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Bold CTRL + SHIFT + B&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;bold&#39;</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Italic CTRL + SHIFT + I&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;italic&#39;</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Underline CTRL + SHIFT + U&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;underline&#39;</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Strike Through&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;strikethrough&#39;</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;color&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Font Color&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;forecolor&#39;</span><span class="p">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;color&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Background Color&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;backcolor&#39;</span><span class="p">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="p">}</span>
                                
                            <span class="p">]</span>
                        <span class="p">},</span>
                        <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="p">},</span>
                        <span class="p">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;indentlist&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Lists&#39;</span><span class="p">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="p">[</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Create an Unordered List&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;insertunorderedlist&#39;</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Create an Ordered List&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;insertorderedlist&#39;</span> <span class="p">}</span>
                            <span class="p">]</span>
                        <span class="p">},</span>
                        <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;separator&#39;</span> <span class="p">},</span>
                        <span class="p">{</span> <span class="nx">group</span><span class="o">:</span> <span class="s1">&#39;insertitem&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Insert Item&#39;</span><span class="p">,</span>
                            <span class="nx">buttons</span><span class="o">:</span> <span class="p">[</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;HTML Link CTRL + SHIFT + L&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;createlink&#39;</span><span class="p">,</span> <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> <span class="p">},</span>
                                <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="nx">label</span><span class="o">:</span> <span class="s1">&#39;Insert Image&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;insertimage&#39;</span> <span class="p">}</span>
                            <span class="p">]</span>
                        <span class="p">}</span>
                    <span class="p">]</span>
                <span class="p">};</span>
            <span class="p">}</span>

            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">SimpleEditor</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">init</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">p_oElement</span><span class="p">,</span> <span class="nx">p_oAttributes</span><span class="p">);</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">EditorInfo</span><span class="p">.</span><span class="nx">_instances</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)]</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>


            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="p">[];</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;contentReady&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">DOMReady</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">fireQueue</span><span class="p">();</span>
            <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method initAttributes</span>
<span class="cm">        * @description Initializes all of the configuration attributes used to create </span>
<span class="cm">        * the editor.</span>
<span class="cm">        * @param {Object} attr Object literal specifying a set of </span>
<span class="cm">        * configuration attributes used to create the editor.</span>
<span class="cm">        */</span>
        <span class="nx">initAttributes</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">attr</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">SimpleEditor</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">initAttributes</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">attr</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

            <span class="cm">/**</span>
<span class="cm">            * @config setDesignMode</span>
<span class="cm">            * @description Should the Editor set designMode on the document. Default: true.</span>
<span class="cm">            * @default true</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;setDesignMode&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="p">((</span><span class="nx">attr</span><span class="p">.</span><span class="nx">setDesignMode</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="p">)</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config nodeChangeDelay</span>
<span class="cm">            * @description Do we wrap the nodeChange method in a timeout for performance. Default: true.</span>
<span class="cm">            * @default true</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;nodeChangeDelay&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="p">((</span><span class="nx">attr</span><span class="p">.</span><span class="nx">nodeChangeDelay</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="p">)</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config maxUndo</span>
<span class="cm">            * @description The max number of undo levels to store.</span>
<span class="cm">            * @default 30</span>
<span class="cm">            * @type Number</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;maxUndo&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">maxUndo</span> <span class="o">||</span> <span class="mi">30</span>
            <span class="p">});</span>

            <span class="cm">/**</span>
<span class="cm">            * @config ptags</span>
<span class="cm">            * @description If true, the editor uses &amp;lt;P&amp;gt; tags instead of &amp;lt;br&amp;gt; tags. (Use Shift + Enter to get a &amp;lt;br&amp;gt;)</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;ptags&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">ptags</span> <span class="o">||</span> <span class="kc">false</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config insert</span>
<span class="cm">            * @description If true, selection is not required for: fontname, fontsize, forecolor, backcolor.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">insert</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">insert</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">insert</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">buttons</span> <span class="o">=</span> <span class="p">{</span>
                            <span class="nx">fontname</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                            <span class="nx">fontsize</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                            <span class="nx">forecolor</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                            <span class="nx">backcolor</span><span class="o">:</span> <span class="kc">true</span>
                        <span class="p">};</span>
                        <span class="kd">var</span> <span class="nx">tmp</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_defaultToolbar</span><span class="p">.</span><span class="nx">buttons</span><span class="p">;</span>
                        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">tmp</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">buttons</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">a</span> <span class="o">&lt;</span> <span class="nx">tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">buttons</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">a</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="nx">tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">buttons</span><span class="p">[</span><span class="nx">a</span><span class="p">].</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">if</span> <span class="p">(</span><span class="nx">buttons</span><span class="p">[</span><span class="nx">tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">buttons</span><span class="p">[</span><span class="nx">a</span><span class="p">].</span><span class="nx">value</span><span class="p">])</span> <span class="p">{</span>
                                            <span class="k">delete</span> <span class="nx">tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">buttons</span><span class="p">[</span><span class="nx">a</span><span class="p">].</span><span class="nx">disabled</span><span class="p">;</span>
                                        <span class="p">}</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config container</span>
<span class="cm">            * @description Used when dynamically creating the Editor from Javascript with no default textarea.</span>
<span class="cm">            * We will create one and place it in this container. If no container is passed we will append to document.body.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type HTMLElement</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;container&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">container</span> <span class="o">||</span> <span class="kc">false</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config plainText</span>
<span class="cm">            * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;plainText&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">plainText</span> <span class="o">||</span> <span class="kc">false</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @private</span>
<span class="cm">            * @config iframe</span>
<span class="cm">            * @description Internal config for holding the iframe element.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type HTMLElement</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @private</span>
<span class="cm">            * @config disabled_iframe</span>
<span class="cm">            * @description Internal config for holding the iframe element used when disabling the Editor.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type HTMLElement</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;disabled_iframe&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @private</span>
<span class="cm">            * @depreciated - No longer used, should use this.get(&#39;element&#39;)</span>
<span class="cm">            * @config textarea</span>
<span class="cm">            * @description Internal config for holding the textarea element (replaced with element).</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type HTMLElement</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;textarea&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config nodeChangeThreshold</span>
<span class="cm">            * @description The number of seconds that need to be in between nodeChange processing</span>
<span class="cm">            * @default 3</span>
<span class="cm">            * @type Number</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;nodeChangeThreshold&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">nodeChangeThreshold</span> <span class="o">||</span> <span class="mi">3</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config allowNoEdit</span>
<span class="cm">            * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes.</span>
<span class="cm">            * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;allowNoEdit&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">allowNoEdit</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isBoolean</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config limitCommands</span>
<span class="cm">            * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;limitCommands&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">limitCommands</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isBoolean</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config element_cont</span>
<span class="cm">            * @description Internal config for the editors container</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type HTMLElement</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">element_cont</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @private</span>
<span class="cm">            * @config editor_wrapper</span>
<span class="cm">            * @description The outter wrapper for the entire editor.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type HTMLElement</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;editor_wrapper&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">editor_wrapper</span> <span class="o">||</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute height</span>
<span class="cm">            * @description The height of the editor iframe container, not including the toolbar..</span>
<span class="cm">            * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">height</span> <span class="o">||</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">),</span> <span class="s1">&#39;height&#39;</span><span class="p">),</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">height</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_rendered</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">//We have been rendered, change the height</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">anim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Anim</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">),</span> <span class="p">{</span>
                                <span class="nx">height</span><span class="o">:</span> <span class="p">{</span>
                                    <span class="nx">to</span><span class="o">:</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">height</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
                                <span class="p">}</span>
                            <span class="p">},</span> <span class="mf">0.5</span><span class="p">);</span>
                            <span class="nx">anim</span><span class="p">.</span><span class="nx">animate</span><span class="p">();</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">),</span> <span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="nx">height</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config autoHeight</span>
<span class="cm">            * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean || Number</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;autoHeight&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">autoHeight</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;scrolling&#39;</span><span class="p">,</span> <span class="s1">&#39;no&#39;</span><span class="p">);</span>
                        <span class="p">}</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;afterNodeChange&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAutoHeight</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;editorKeyDown&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAutoHeight</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;editorKeyPress&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAutoHeight</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;scrolling&#39;</span><span class="p">,</span> <span class="s1">&#39;auto&#39;</span><span class="p">);</span>
                        <span class="p">}</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribe</span><span class="p">(</span><span class="s1">&#39;afterNodeChange&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAutoHeight</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribe</span><span class="p">(</span><span class="s1">&#39;editorKeyDown&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAutoHeight</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribe</span><span class="p">(</span><span class="s1">&#39;editorKeyPress&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAutoHeight</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute width</span>
<span class="cm">            * @description The width of the editor container.</span>
<span class="cm">            * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;width&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">width</span> <span class="o">||</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">),</span> <span class="s1">&#39;width&#39;</span><span class="p">),</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">width</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_rendered</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">//We have been rendered, change the width</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">anim</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Anim</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">),</span> <span class="p">{</span>
                                <span class="nx">width</span><span class="o">:</span> <span class="p">{</span>
                                    <span class="nx">to</span><span class="o">:</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">width</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
                                <span class="p">}</span>
                            <span class="p">},</span> <span class="mf">0.5</span><span class="p">);</span>
                            <span class="nx">anim</span><span class="p">.</span><span class="nx">animate</span><span class="p">();</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;width&#39;</span><span class="p">,</span> <span class="nx">width</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
                        
            <span class="cm">/**</span>
<span class="cm">            * @attribute blankimage</span>
<span class="cm">            * @description The URL for the image placeholder to put in when inserting an image.</span>
<span class="cm">            * @default The yahooapis.com address for the current release + &#39;assets/blankimage.png&#39;</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;blankimage&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">blankimage</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getBlankImage</span><span class="p">()</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute css</span>
<span class="cm">            * @description The Base CSS used to format the content of the editor</span>
<span class="cm">            * @default &lt;code&gt;&lt;pre&gt;html {</span>
<span class="cm">                height: 95%;</span>
<span class="cm">            }</span>
<span class="cm">            body {</span>
<span class="cm">                height: 100%;</span>
<span class="cm">                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;</span>
<span class="cm">            }</span>
<span class="cm">            a {</span>
<span class="cm">                color: blue;</span>
<span class="cm">                text-decoration: underline;</span>
<span class="cm">                cursor: pointer;</span>
<span class="cm">            }</span>
<span class="cm">            .warning-localfile {</span>
<span class="cm">                border-bottom: 1px dashed red !important;</span>
<span class="cm">            }</span>
<span class="cm">            .yui-busy {</span>
<span class="cm">                cursor: wait !important;</span>
<span class="cm">            }</span>
<span class="cm">            img.selected { //Safari image selection</span>
<span class="cm">                border: 2px dotted #808080;</span>
<span class="cm">            }</span>
<span class="cm">            img {</span>
<span class="cm">                cursor: pointer !important;</span>
<span class="cm">                border: none;</span>
<span class="cm">            }</span>
<span class="cm">            &lt;/pre&gt;&lt;/code&gt;</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;css&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">css</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_defaultCSS</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute html</span>
<span class="cm">            * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item)</span>
<span class="cm">            * @default This HTML requires a few things if you are to override:</span>
<span class="cm">                &lt;p&gt;&lt;code&gt;{TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS}&lt;/code&gt; and &lt;code&gt;{CONTENT}&lt;/code&gt; need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.&lt;p&gt;</span>
<span class="cm">                &lt;p&gt;&lt;code&gt;onload=&quot;document.body._rteLoaded = true;&quot;&lt;/code&gt; : the onload statement must be there or the editor will not finish loading.&lt;/p&gt;</span>
<span class="cm">                &lt;code&gt;</span>
<span class="cm">                &lt;pre&gt;</span>
<span class="cm">                &amp;lt;html&amp;gt;</span>
<span class="cm">                    &amp;lt;head&amp;gt;</span>
<span class="cm">                        &amp;lt;title&amp;gt;{TITLE}&amp;lt;/title&amp;gt;</span>
<span class="cm">                        &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&amp;gt;</span>
<span class="cm">                        &amp;lt;style&amp;gt;</span>
<span class="cm">                        {CSS}</span>
<span class="cm">                        &amp;lt;/style&amp;gt;</span>
<span class="cm">                        &amp;lt;style&amp;gt;</span>
<span class="cm">                        {HIDDEN_CSS}</span>
<span class="cm">                        &amp;lt;/style&amp;gt;</span>
<span class="cm">                        &amp;lt;style&amp;gt;</span>
<span class="cm">                        {EXTRA_CSS}</span>
<span class="cm">                        &amp;lt;/style&amp;gt;</span>
<span class="cm">                    &amp;lt;/head&amp;gt;</span>
<span class="cm">                &amp;lt;body onload=&quot;document.body._rteLoaded = true;&quot;&amp;gt;</span>
<span class="cm">                {CONTENT}</span>
<span class="cm">                &amp;lt;/body&amp;gt;</span>
<span class="cm">                &amp;lt;/html&amp;gt;</span>
<span class="cm">                &lt;/pre&gt;</span>
<span class="cm">                &lt;/code&gt;</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;html&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">html</span> <span class="o">||</span> <span class="s1">&#39;&lt;html&gt;&lt;head&gt;&lt;title&gt;{TITLE}&lt;/title&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;&lt;base href=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_baseHREF</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&lt;style&gt;{CSS}&lt;/style&gt;&lt;style&gt;{HIDDEN_CSS}&lt;/style&gt;&lt;style&gt;{EXTRA_CSS}&lt;/style&gt;&lt;/head&gt;&lt;body onload=&quot;document.body._rteLoaded = true;&quot;&gt;{CONTENT}&lt;/body&gt;&lt;/html&gt;&#39;</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="p">});</span>

            <span class="cm">/**</span>
<span class="cm">            * @attribute extracss</span>
<span class="cm">            * @description Extra user defined css to load after the default SimpleEditor CSS</span>
<span class="cm">            * @default &#39;&#39;</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;extracss&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">extracss</span> <span class="o">||</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="p">});</span>

            <span class="cm">/**</span>
<span class="cm">            * @attribute handleSubmit</span>
<span class="cm">            * @description Config handles if the editor will attach itself to the textareas parent form&#39;s submit handler.</span>
<span class="cm">            If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.</span>
<span class="cm">            Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;handleSubmit&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">handleSubmit</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">exec</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">form</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_formButtons</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_formButtons</span> <span class="o">=</span> <span class="p">[];</span>
                        <span class="p">}</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">exec</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">form</span><span class="p">,</span> <span class="s1">&#39;submit&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFormSubmit</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                            <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">form</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;input&#39;</span><span class="p">);</span>
                            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">s</span> <span class="o">&lt;</span> <span class="nx">i</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">s</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="kd">var</span> <span class="nx">type</span> <span class="o">=</span> <span class="nx">i</span><span class="p">[</span><span class="nx">s</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">);</span>
                                <span class="k">if</span> <span class="p">(</span><span class="nx">type</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">type</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;submit&#39;</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">i</span><span class="p">[</span><span class="nx">s</span><span class="p">],</span> <span class="s1">&#39;click&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFormButtonClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_formButtons</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">_formButtons</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">i</span><span class="p">[</span><span class="nx">s</span><span class="p">];</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">form</span><span class="p">,</span> <span class="s1">&#39;submit&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFormSubmit</span><span class="p">);</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_formButtons</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_formButtons</span><span class="p">,</span> <span class="s1">&#39;click&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFormButtonClick</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute disabled</span>
<span class="cm">            * @description This will toggle the editor&#39;s disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.</span>
<span class="cm">            All Toolbar buttons are also disabled so they cannot be used.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_rendered</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_disableEditor</span><span class="p">(</span><span class="nx">disabled</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config saveEl</span>
<span class="cm">            * @description When save HTML is called, this element will be updated as well as the source of data.</span>
<span class="cm">            * @default element</span>
<span class="cm">            * @type HTMLElement</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;saveEl&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">)</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config toolbar_cont</span>
<span class="cm">            * @description Internal config for the toolbars container</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;toolbar_cont&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute toolbar</span>
<span class="cm">            * @description The default toolbar config.</span>
<span class="cm">            * @type Object</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;toolbar&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">toolbar</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_defaultToolbar</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">toolbar</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">buttonType</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">toolbar</span><span class="p">.</span><span class="nx">buttonType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_defaultToolbar</span><span class="p">.</span><span class="nx">buttonType</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_defaultToolbar</span> <span class="o">=</span> <span class="nx">toolbar</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute animate</span>
<span class="cm">            * @description Should the editor animate window movements</span>
<span class="cm">            * @default false unless Animation is found, then true</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="p">((</span><span class="nx">attr</span><span class="p">.</span><span class="nx">animate</span><span class="p">)</span> <span class="o">?</span> <span class="p">((</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Anim</span><span class="p">)</span> <span class="o">?</span> <span class="kc">true</span> <span class="o">:</span> <span class="kc">false</span><span class="p">)</span> <span class="o">:</span> <span class="kc">false</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Anim</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">ret</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @config panel</span>
<span class="cm">            * @description A reference to the panel we are using for windows.</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;panel&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Overlay</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">ret</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
                <span class="p">}</span>               
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute focusAtStart</span>
<span class="cm">            * @description Should we focus the window when the content is ready?</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;focusAtStart&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">focusAtStart</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fs</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">fs</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;editorContentLoaded&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                            <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                                <span class="nx">self</span><span class="p">.</span><span class="nx">focus</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                                <span class="nx">self</span><span class="p">.</span><span class="nx">editorDirty</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                            <span class="p">},</span> <span class="mi">400</span><span class="p">);</span>
                        <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute dompath</span>
<span class="cm">            * @description Toggle the display of the current Dom path below the editor</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;dompath&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">dompath</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">dompath</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">dompath</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">dompath</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;DIV&#39;</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;_dompath&#39;</span><span class="p">;</span>
                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">,</span> <span class="s1">&#39;dompath&#39;</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;firstChild&#39;</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_writeDomPath</span><span class="p">();</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">dompath</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dompath</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">dompath</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute markup</span>
<span class="cm">            * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml</span>
<span class="cm">            * @default &quot;semantic&quot;</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;markup&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">markup</span> <span class="o">||</span> <span class="s1">&#39;semantic&#39;</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">markup</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">switch</span> <span class="p">(</span><span class="nx">markup</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">())</span> <span class="p">{</span>
                        <span class="k">case</span> <span class="s1">&#39;semantic&#39;</span><span class="o">:</span>
                        <span class="k">case</span> <span class="s1">&#39;css&#39;</span><span class="o">:</span>
                        <span class="k">case</span> <span class="s1">&#39;default&#39;</span><span class="o">:</span>
                        <span class="k">case</span> <span class="s1">&#39;xhtml&#39;</span><span class="o">:</span>
                        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">});</span>
            <span class="cm">/**</span>
<span class="cm">            * @attribute removeLineBreaks</span>
<span class="cm">            * @description Should we remove linebreaks and extra spaces on cleanup</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>            
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;removeLineBreaks&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">removeLineBreaks</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isBoolean</span>
            <span class="p">});</span>
            
            <span class="cm">/**</span>
<span class="cm">            * @config drag</span>
<span class="cm">            * @description Set this config to make the Editor draggable, pass &#39;proxy&#39; to make use YAHOO.util.DDProxy.</span>
<span class="cm">            * @type {Boolean/String}</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;drag&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">drag</span> <span class="o">||</span> <span class="kc">false</span>
            <span class="p">});</span>

            <span class="cm">/**</span>
<span class="cm">            * @config resize</span>
<span class="cm">            * @description Set this to true to make the Editor Resizable with YAHOO.util.Resize. The default config is available: myEditor._resizeConfig</span>
<span class="cm">            * Animation will be ignored while performing this resize to allow for the dynamic change in size of the toolbar.</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;resize&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">resize</span> <span class="o">||</span> <span class="kc">false</span>
            <span class="p">});</span>

            <span class="cm">/**</span>
<span class="cm">            * @config filterWord</span>
<span class="cm">            * @description Attempt to filter out MS Word HTML from the Editor&#39;s output.</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s1">&#39;filterWord&#39;</span><span class="p">,</span> <span class="p">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="p">.</span><span class="nx">filterWord</span> <span class="o">||</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isBoolean</span>
            <span class="p">});</span>

        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _getBlankImage</span>
<span class="cm">        * @description Retrieves the full url of the image to use as the blank image.</span>
<span class="cm">        * @return {String} The URL to the blank image</span>
<span class="cm">        */</span>
        <span class="nx">_getBlankImage</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">DOMReady</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_queue</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">_queue</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;_getBlankImage&#39;</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">];</span>
                <span class="k">return</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">img</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_blankImageLoaded</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">EditorInfo</span><span class="p">.</span><span class="nx">blankImage</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;blankimage&#39;</span><span class="p">,</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">EditorInfo</span><span class="p">.</span><span class="nx">blankImage</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_blankImageLoaded</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">div</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
                    <span class="nx">div</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">position</span> <span class="o">=</span> <span class="s1">&#39;absolute&#39;</span><span class="p">;</span>
                    <span class="nx">div</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">top</span> <span class="o">=</span> <span class="s1">&#39;-9999px&#39;</span><span class="p">;</span>
                    <span class="nx">div</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">left</span> <span class="o">=</span> <span class="s1">&#39;-9999px&#39;</span><span class="p">;</span>
                    <span class="nx">div</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-blankimage&#39;</span><span class="p">;</span>
                    <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">div</span><span class="p">);</span>
                    <span class="nx">img</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">div</span><span class="p">,</span> <span class="s1">&#39;background-image&#39;</span><span class="p">);</span>
                    <span class="nx">img</span> <span class="o">=</span> <span class="nx">img</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">&#39;url(&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&quot;/g</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                    <span class="c1">//Adobe AIR Code</span>
                    <span class="nx">img</span> <span class="o">=</span> <span class="nx">img</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="s1">&#39;app:/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>             
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;blankimage&#39;</span><span class="p">,</span> <span class="nx">img</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_blankImageLoaded</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="nx">div</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">div</span><span class="p">);</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">EditorInfo</span><span class="p">.</span><span class="nx">blankImage</span> <span class="o">=</span> <span class="nx">img</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">img</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;blankimage&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">img</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleAutoHeight</span>
<span class="cm">        * @description Handles resizing the editor&#39;s height based on the content</span>
<span class="cm">        */</span>
        <span class="nx">_handleAutoHeight</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">(),</span>
                <span class="nx">body</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">body</span><span class="p">,</span>
                <span class="nx">docEl</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">documentElement</span><span class="p">;</span>

            <span class="kd">var</span> <span class="nx">height</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;editor_wrapper&#39;</span><span class="p">),</span> <span class="s1">&#39;height&#39;</span><span class="p">),</span> <span class="mi">10</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">newHeight</span> <span class="o">=</span> <span class="nx">body</span><span class="p">.</span><span class="nx">scrollHeight</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">newHeight</span> <span class="o">=</span> <span class="nx">docEl</span><span class="p">.</span><span class="nx">scrollHeight</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">newHeight</span> <span class="o">&lt;</span> <span class="nb">parseInt</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">),</span> <span class="mi">10</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">newHeight</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">),</span> <span class="mi">10</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">((</span><span class="nx">height</span> <span class="o">!=</span> <span class="nx">newHeight</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">newHeight</span> <span class="o">&gt;=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">),</span> <span class="mi">10</span><span class="p">)))</span> <span class="p">{</span>   
                <span class="kd">var</span> <span class="nx">anim</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="nx">newHeight</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;animate&#39;</span><span class="p">,</span> <span class="nx">anim</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">//Internet Explorer needs this</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="s1">&#39;99%&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;zoom&#39;</span><span class="p">,</span> <span class="s1">&#39;1&#39;</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                    <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="nx">self</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="s1">&#39;100%&#39;</span><span class="p">);</span>
                    <span class="p">},</span> <span class="mi">1</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _formButtons</span>
<span class="cm">        * @description Array of buttons that are in the Editor&#39;s parent form (for handleSubmit)</span>
<span class="cm">        * @type Array</span>
<span class="cm">        */</span>
        <span class="nx">_formButtons</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @property _formButtonClicked</span>
<span class="cm">        * @description The form button that was clicked to submit the form.</span>
<span class="cm">        * @type HTMLElement</span>
<span class="cm">        */</span>
        <span class="nx">_formButtonClicked</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleFormButtonClick</span>
<span class="cm">        * @description The click listener assigned to each submit button in the Editor&#39;s parent form.</span>
<span class="cm">        * @param {Event} ev The click event</span>
<span class="cm">        */</span>
        <span class="nx">_handleFormButtonClick</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">ev</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_formButtonClicked</span> <span class="o">=</span> <span class="nx">tar</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleFormSubmit</span>
<span class="cm">        * @description Handles the form submission.</span>
<span class="cm">        * @param {Object} ev The Form Submit Event</span>
<span class="cm">        */</span>
        <span class="nx">_handleFormSubmit</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">saveHTML</span><span class="p">();</span>

            <span class="kd">var</span> <span class="nx">form</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">form</span><span class="p">,</span>
                <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_formButtonClicked</span> <span class="o">||</span> <span class="kc">false</span><span class="p">;</span>

            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">form</span><span class="p">,</span> <span class="s1">&#39;submit&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFormSubmit</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ua</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//form.fireEvent(&quot;onsubmit&quot;);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">tar</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">tar</span><span class="p">.</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">tar</span><span class="p">.</span><span class="nx">click</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>  <span class="c1">// Gecko, Opera, and Safari</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">tar</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">tar</span><span class="p">.</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">tar</span><span class="p">.</span><span class="nx">click</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="kd">var</span> <span class="nx">oEvent</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createEvent</span><span class="p">(</span><span class="s2">&quot;HTMLEvents&quot;</span><span class="p">);</span>
                <span class="nx">oEvent</span><span class="p">.</span><span class="nx">initEvent</span><span class="p">(</span><span class="s2">&quot;submit&quot;</span><span class="p">,</span> <span class="kc">true</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
                <span class="nx">form</span><span class="p">.</span><span class="nx">dispatchEvent</span><span class="p">(</span><span class="nx">oEvent</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ua</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span><span class="p">(</span><span class="nx">form</span><span class="p">.</span><span class="nx">submit</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">form</span><span class="p">.</span><span class="nx">submit</span><span class="p">();</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">//2.6.0</span>
            <span class="c1">//Removed this, not need since removing Safari 2.x</span>
            <span class="c1">//Event.stopEvent(ev);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleFontSize</span>
<span class="cm">        * @description Handles the font size button in the toolbar.</span>
<span class="cm">        * @param {Object} o Object returned from Toolbar&#39;s buttonClick Event</span>
<span class="cm">        */</span>
        <span class="nx">_handleFontSize</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonById</span><span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">id</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nx">button</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;fontsize&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @description Handles the colorpicker buttons in the toolbar.</span>
<span class="cm">        * @param {Object} o Object returned from Toolbar&#39;s buttonClick Event</span>
<span class="cm">        */</span>
        <span class="nx">_handleColorPicker</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">o</span><span class="p">.</span><span class="nx">button</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="s1">&#39;#&#39;</span> <span class="o">+</span> <span class="nx">o</span><span class="p">.</span><span class="nx">color</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">((</span><span class="nx">cmd</span> <span class="o">==</span> <span class="s1">&#39;forecolor&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">cmd</span> <span class="o">==</span> <span class="s1">&#39;backcolor&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="nx">cmd</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleAlign</span>
<span class="cm">        * @description Handles the alignment buttons in the toolbar.</span>
<span class="cm">        * @param {Object} o Object returned from Toolbar&#39;s buttonClick Event</span>
<span class="cm">        */</span>
        <span class="nx">_handleAlign</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">o</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">menu</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">o</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">cmd</span> <span class="o">=</span> <span class="nx">o</span><span class="p">.</span><span class="nx">button</span><span class="p">.</span><span class="nx">menu</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">value</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">();</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">execCommand</span><span class="p">(</span><span class="nx">cmd</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
            <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleAfterNodeChange</span>
<span class="cm">        * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).</span>
<span class="cm">        */</span>
        <span class="nx">_handleAfterNodeChange</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">path</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDomPath</span><span class="p">(),</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">family</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">fontsize</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">validFont</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">fn_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;fontname&#39;</span><span class="p">),</span>
                <span class="nx">fs_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;fontsize&#39;</span><span class="p">),</span>
                <span class="nx">hd_button</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;heading&#39;</span><span class="p">);</span>

            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">path</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elm</span> <span class="o">=</span> <span class="nx">path</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>

                <span class="kd">var</span> <span class="nx">tag</span> <span class="o">=</span> <span class="nx">elm</span><span class="p">.</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>


                <span class="k">if</span> <span class="p">(</span><span class="nx">elm</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">tag</span> <span class="o">=</span> <span class="nx">elm</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">);</span>
                <span class="p">}</span>

                <span class="nx">family</span> <span class="o">=</span> <span class="nx">elm</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;face&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;font-family&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">family</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;font-family&#39;</span><span class="p">);</span>
                    <span class="c1">//Adobe AIR Code</span>
                    <span class="nx">family</span> <span class="o">=</span> <span class="nx">family</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&#39;/g</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>                    
                <span class="p">}</span>

                <span class="k">if</span> <span class="p">(</span><span class="nx">tag</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;h&#39;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">hd_button</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">h</span> <span class="o">&lt;</span> <span class="nx">hd_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">value</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">h</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">hd_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">value</span><span class="p">[</span><span class="nx">h</span><span class="p">].</span><span class="nx">value</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="nx">tag</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">hd_button</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">,</span> <span class="nx">hd_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">value</span><span class="p">[</span><span class="nx">h</span><span class="p">].</span><span class="nx">text</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_updateMenuChecked</span><span class="p">(</span><span class="s1">&#39;heading&#39;</span><span class="p">,</span> <span class="nx">tag</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">fn_button</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">b</span> <span class="o">&lt;</span> <span class="nx">fn_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">value</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">b</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">family</span> <span class="o">&amp;&amp;</span> <span class="nx">fn_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">value</span><span class="p">[</span><span class="nx">b</span><span class="p">].</span><span class="nx">text</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="nx">family</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">())</span> <span class="p">{</span>
                        <span class="nx">validFont</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="nx">family</span> <span class="o">=</span> <span class="nx">fn_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">value</span><span class="p">[</span><span class="nx">b</span><span class="p">].</span><span class="nx">text</span><span class="p">;</span> <span class="c1">//Put the proper menu name in the button</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">validFont</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">family</span> <span class="o">=</span> <span class="nx">fn_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">label</span><span class="p">.</span><span class="nx">_initialConfig</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="kd">var</span> <span class="nx">familyLabel</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-fontname-&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_cleanClassName</span><span class="p">(</span><span class="nx">family</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">family</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="p">;</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">fn_button</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="nx">familyLabel</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">fn_button</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">,</span> <span class="nx">familyLabel</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_updateMenuChecked</span><span class="p">(</span><span class="s1">&#39;fontname&#39;</span><span class="p">,</span> <span class="nx">family</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">fs_button</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">fontsize</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;fontSize&#39;</span><span class="p">),</span> <span class="mi">10</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">((</span><span class="nx">fontsize</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="o">||</span> <span class="nb">isNaN</span><span class="p">(</span><span class="nx">fontsize</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">fontsize</span> <span class="o">=</span> <span class="nx">fs_button</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">label</span><span class="p">.</span><span class="nx">_initialConfig</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="nx">fs_button</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;label&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="o">+</span><span class="nx">fontsize</span><span class="p">);</span>
            <span class="p">}</span>
            
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="nx">fn_button</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="nx">fs_button</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="s1">&#39;forecolor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="s1">&#39;backcolor&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Overlay</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="s1">&#39;createlink&#39;</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;blockquote&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">selectButton</span><span class="p">(</span><span class="s1">&#39;indent&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">disableButton</span><span class="p">(</span><span class="s1">&#39;indent&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">enableButton</span><span class="p">(</span><span class="s1">&#39;outdent&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;ol&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">elm</span><span class="p">,</span> <span class="s1">&#39;ul&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">disableButton</span><span class="p">(</span><span class="s1">&#39;indent&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_lastButton</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleInsertImageClick</span>
<span class="cm">        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.</span>
<span class="cm">        */</span>
        <span class="nx">_handleInsertImageClick</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;limitCommands&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;insertimage&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Toolbar Button for (insertimage) was not found, skipping exec.&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span> <span class="c1">//Disable the toolbar when the prompt is showing</span>
            <span class="kd">var</span> <span class="nx">_handleAEC</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
                    <span class="nx">src</span> <span class="o">=</span> <span class="s1">&#39;http://&#39;</span><span class="p">;</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">src</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">src</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;blankimage&#39;</span><span class="p">))</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">src</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">STR_IMAGE_HERE</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="kd">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="nx">prompt</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">STR_IMAGE_URL</span> <span class="o">+</span> <span class="s1">&#39;: &#39;</span><span class="p">,</span> <span class="nx">src</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">((</span><span class="nx">str</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">str</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">el</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="nx">str</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">str</span> <span class="o">===</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="p">[];</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">((</span><span class="nx">str</span> <span class="o">===</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">src</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">src</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;blankimage&#39;</span><span class="p">))</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="p">[];</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribe</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">_handleAEC</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="p">};</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">_handleAEC</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleInsertImageWindowClose</span>
<span class="cm">        * @description Handles the closing of the Image Properties Window.</span>
<span class="cm">        */</span>
        <span class="nx">_handleInsertImageWindowClose</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _isLocalFile</span>
<span class="cm">        * @param {String} url THe url/string to check</span>
<span class="cm">        * @description Checks to see if a string (href or img src) is possibly a local file reference..</span>
<span class="cm">        */</span>
        <span class="nx">_isLocalFile</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">((</span><span class="nx">url</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">url</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="nx">url</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;file:/&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">url</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;:\\&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleCreateLinkClick</span>
<span class="cm">        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.</span>
<span class="cm">        */</span>
        <span class="nx">_handleCreateLinkClick</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;limitCommands&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="s1">&#39;createlink&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Toolbar Button for (createlink) was not found, skipping exec.&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span> <span class="c1">//Disable the toolbar when the prompt is showing</span>

            <span class="kd">var</span> <span class="nx">_handleAEC</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
                    <span class="nx">url</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>

                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;href&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">url</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;href&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="kd">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="nx">prompt</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">STR_LINK_URL</span> <span class="o">+</span> <span class="s1">&#39;: &#39;</span><span class="p">,</span> <span class="nx">url</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">((</span><span class="nx">str</span> <span class="o">!==</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">str</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">urlValue</span> <span class="o">=</span> <span class="nx">str</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">((</span><span class="nx">urlValue</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;:/&#39;</span><span class="o">+</span><span class="s1">&#39;/&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">urlValue</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span> <span class="o">!=</span> <span class="s1">&#39;/&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">urlValue</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">6</span><span class="p">).</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">!=</span> <span class="s1">&#39;mailto&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">((</span><span class="nx">urlValue</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;@&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">urlValue</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">6</span><span class="p">).</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">!=</span> <span class="s1">&#39;mailto&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="c1">//Found an @ sign, prefix with mailto:</span>
                            <span class="nx">urlValue</span> <span class="o">=</span> <span class="s1">&#39;mailto:&#39;</span> <span class="o">+</span> <span class="nx">urlValue</span><span class="p">;</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="cm">/* :// not found adding */</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">urlValue</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> <span class="o">!=</span> <span class="s1">&#39;#&#39;</span><span class="p">)</span> <span class="p">{</span>
                                <span class="c1">//urlValue = &#39;http:/&#39;+&#39;/&#39; + urlValue;</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="nx">el</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;href&#39;</span><span class="p">,</span> <span class="nx">urlValue</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">str</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">);</span>
                    <span class="nx">_span</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">;</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">_span</span><span class="p">,</span> <span class="s1">&#39;yui-non&#39;</span><span class="p">);</span>
                    <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">_span</span><span class="p">,</span> <span class="nx">el</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribe</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">_handleAEC</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="p">};</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">_handleAEC</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>

        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _handleCreateLinkWindowClose</span>
<span class="cm">        * @description Handles the closing of the Link Properties Window.</span>
<span class="cm">        */</span>
        <span class="nx">_handleCreateLinkWindowClose</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="p">[];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method render</span>
<span class="cm">        * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load.</span>
<span class="cm">        */</span>
        <span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_rendered</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Render&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">DOMReady</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;!DOMReady&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_queue</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">_queue</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;render&#39;</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">];</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">tagName</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_textarea</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">!==</span> <span class="s1">&#39;textarea&#39;</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_textarea</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;No Valid Element&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;No Element&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_rendered</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
            <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="nx">self</span><span class="p">.</span><span class="nx">_render</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
            <span class="p">},</span> <span class="mi">4</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _render</span>
<span class="cm">        * @description Causes the toolbar and the editor to render and replace the textarea.</span>
<span class="cm">        */</span>
        <span class="nx">_render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;textarea&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">));</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;display&#39;</span><span class="p">,</span> <span class="s1">&#39;none&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">addClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_CONTAINER</span><span class="p">);</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createIframe</span><span class="p">());</span>

            <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="nx">self</span><span class="p">.</span><span class="nx">_setInitialContent</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
            <span class="p">},</span> <span class="mi">10</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;editor_wrapper&#39;</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">));</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_disableEditor</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="kd">var</span> <span class="nx">tbarConf</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;toolbar&#39;</span><span class="p">);</span>
            <span class="c1">//Create Toolbar instance</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">tbarConf</span> <span class="k">instanceof</span> <span class="nx">Toolbar</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span> <span class="o">=</span> <span class="nx">tbarConf</span><span class="p">;</span>
                <span class="c1">//Set the toolbar to disabled until content is loaded</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="c1">//Set the toolbar to disabled until content is loaded</span>
                <span class="nx">tbarConf</span><span class="p">.</span><span class="nx">disabled</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Toolbar</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;toolbar_cont&#39;</span><span class="p">),</span> <span class="nx">tbarConf</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;fireEvent::toolbarLoaded&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;toolbarLoaded&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;toolbarLoaded&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span> <span class="p">});</span>

            
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;toolbarCollapsed&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">moveWindow</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;toolbarExpanded&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">moveWindow</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;fontsizeClick&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleFontSize</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;colorPickerClicked&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_handleColorPicker</span><span class="p">(</span><span class="nx">o</span><span class="p">);</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span> <span class="c1">//Stop the buttonClick event</span>
            <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;alignClick&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAlign</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;afterNodeChange&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleAfterNodeChange</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;insertimageClick&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleInsertImageClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;windowinsertimageClose&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleInsertImageWindowClose</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;createlinkClick&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleCreateLinkClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;windowcreatelinkClose&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_handleCreateLinkWindowClose</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            

            <span class="c1">//Replace Textarea with editable area</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">).</span><span class="nx">replaceChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">),</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">));</span>

            
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;hidden&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;absolute&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;top&#39;</span><span class="p">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">));</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;display&#39;</span><span class="p">,</span> <span class="s1">&#39;block&#39;</span><span class="p">);</span>


            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">),</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_EDITABLE_CONT</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">addClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_EDITABLE</span><span class="p">);</span>

            <span class="c1">//Set height and width of editor container</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;width&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;width&#39;</span><span class="p">));</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">),</span> <span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">));</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;width&#39;</span><span class="p">,</span> <span class="s1">&#39;100%&#39;</span><span class="p">);</span> <span class="c1">//WIDTH</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="s1">&#39;100%&#39;</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">_setupDD</span><span class="p">();</span>

            <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="nx">self</span><span class="p">.</span><span class="nx">_setupAfterElement</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
            <span class="p">},</span> <span class="mi">0</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;afterRender&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterRender&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method execCommand</span>
<span class="cm">        * @param {String} action The &quot;execCommand&quot; action to try to execute (Example: bold, insertimage, inserthtml)</span>
<span class="cm">        * @param {String} value (optional) The value for a given action such as action: fontname value: &#39;Verdana&#39;</span>
<span class="cm">        * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions</span>
<span class="cm">        */</span>
        <span class="nx">execCommand</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">action</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">beforeExec</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;beforeExecCommand&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;beforeExecCommand&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">args</span><span class="o">:</span> <span class="nx">arguments</span> <span class="p">});</span>
            <span class="k">if</span> <span class="p">((</span><span class="nx">beforeExec</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">STOP_EXEC_COMMAND</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">STOP_EXEC_COMMAND</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_lastCommand</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setMarkupType</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_getWindow</span><span class="p">().</span><span class="nx">focus</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;limitCommands&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">getButtonByValue</span><span class="p">(</span><span class="nx">action</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Toolbar Button for (&#39;</span> <span class="o">+</span> <span class="nx">action</span> <span class="o">+</span> <span class="s1">&#39;) was not found, skipping exec.&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">editorDirty</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            
            <span class="k">if</span> <span class="p">((</span><span class="k">typeof</span> <span class="k">this</span><span class="p">[</span><span class="s1">&#39;cmd_&#39;</span> <span class="o">+</span> <span class="nx">action</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()]</span> <span class="o">==</span> <span class="s1">&#39;function&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">exec</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Found execCommand override method: (cmd_&#39;</span> <span class="o">+</span> <span class="nx">action</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">retValue</span> <span class="o">=</span> <span class="k">this</span><span class="p">[</span><span class="s1">&#39;cmd_&#39;</span> <span class="o">+</span> <span class="nx">action</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()](</span><span class="nx">value</span><span class="p">);</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="nx">retValue</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">retValue</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> <span class="p">{</span>
                    <span class="nx">action</span> <span class="o">=</span> <span class="nx">retValue</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">retValue</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span> <span class="p">{</span>
                    <span class="nx">value</span> <span class="o">=</span> <span class="nx">retValue</span><span class="p">[</span><span class="mi">2</span><span class="p">];</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">exec</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;execCommand::(&#39;</span> <span class="o">+</span> <span class="nx">action</span> <span class="o">+</span> <span class="s1">&#39;), (&#39;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="nx">action</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;execCommand Failed&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;OVERRIDE::execCommand::(&#39;</span> <span class="o">+</span> <span class="nx">action</span> <span class="o">+</span> <span class="s1">&#39;),(&#39;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;) skipped&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
            <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;afterExecCommand&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="p">});</span>
            
        <span class="p">},</span>
    <span class="cm">/* {{{  Command Overrides */</span>

        <span class="cm">/**</span>
<span class="cm">        * @method cmd_bold</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;bold&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_bold</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;span&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontWeight</span> <span class="o">==</span> <span class="s1">&#39;bold&#39;</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontWeight</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                        <span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;b&#39;</span><span class="p">),</span>
                        <span class="nx">par</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
                        <span class="nx">par</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">b</span><span class="p">,</span> <span class="nx">el</span><span class="p">);</span>
                        <span class="nx">b</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="kc">true</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_italic</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;italic&#39;) is used.</span>
<span class="cm">        */</span>

        <span class="nx">cmd_italic</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;span&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontStyle</span> <span class="o">==</span> <span class="s1">&#39;italic&#39;</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontStyle</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                        <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">),</span>
                        <span class="nx">par</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
                        <span class="nx">par</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">i</span><span class="p">,</span> <span class="nx">el</span><span class="p">);</span>
                        <span class="nx">i</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="kc">true</span><span class="p">];</span>
        <span class="p">},</span>


        <span class="cm">/**</span>
<span class="cm">        * @method cmd_underline</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;underline&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_underline</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;span&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">textDecoration</span> <span class="o">==</span> <span class="s1">&#39;underline&#39;</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">textDecoration</span> <span class="o">=</span> <span class="s1">&#39;none&#39;</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">textDecoration</span> <span class="o">=</span> <span class="s1">&#39;underline&#39;</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">return</span> <span class="p">[</span><span class="kc">false</span><span class="p">];</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="kc">true</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_backcolor</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;backcolor&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_backcolor</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span>
                <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;backcolor&#39;</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">gecko</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_setEditorStyle</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;hilitecolor&#39;</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">backgroundColor</span> <span class="o">=</span> <span class="nx">value</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createInsertElement</span><span class="p">({</span> <span class="nx">backgroundColor</span><span class="o">:</span> <span class="nx">value</span> <span class="p">});</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">backgroundColor</span><span class="o">:</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">color</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">color</span><span class="p">,</span> <span class="nx">fontSize</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontSize</span><span class="p">,</span> <span class="nx">fontFamily</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontFamily</span> <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                <span class="p">}</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">return</span> <span class="p">[</span><span class="nx">exec</span><span class="p">,</span> <span class="nx">action</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_forecolor</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;forecolor&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_forecolor</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;color&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createInsertElement</span><span class="p">({</span> <span class="nx">color</span><span class="o">:</span> <span class="nx">value</span> <span class="p">});</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">color</span><span class="o">:</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">fontSize</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontSize</span><span class="p">,</span> <span class="nx">fontFamily</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontFamily</span><span class="p">,</span> <span class="nx">backgroundColor</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">backgroundColor</span> <span class="p">});</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                    <span class="p">}</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">return</span> <span class="p">[</span><span class="nx">exec</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_unlink</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;unlink&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_unlink</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_swapEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">el</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-non&#39;</span><span class="p">;</span>
            <span class="p">});</span>
            <span class="k">return</span> <span class="p">[</span><span class="kc">false</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_createlink</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;createlink&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_createlink</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span> <span class="nx">_a</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hasParent</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">_a</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">);</span>
                <span class="nx">_a</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">;</span>
                <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                <span class="nx">el</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">_a</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">_a</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;a&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">);</span>
                <span class="nx">_a</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_swapEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s1">&#39;a&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">_a</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="kc">false</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_insertimage</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;insertimage&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_insertimage</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">_img</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;insertimage&#39;</span><span class="p">,</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">===</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;blankimage&#39;</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="cm">/*</span>
<span class="cm">            * @knownissue Safari Cursor Position</span>
<span class="cm">            * @browser Safari 2.x</span>
<span class="cm">            * @description The issue here is that we have no way of knowing where the cursor position is</span>
<span class="cm">            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.</span>
<span class="cm">            */</span>
            
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;InsertImage: &#39;</span> <span class="o">+</span> <span class="nx">el</span><span class="p">.</span><span class="nx">tagName</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;img&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">queryCommandEnabled</span><span class="p">(</span><span class="nx">action</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="nx">action</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">imgs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">);</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">imgs</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">imgs</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;yui-img&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">imgs</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;yui-img&#39;</span><span class="p">);</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">imgs</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">==</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">_img</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">);</span>
                        <span class="nx">_img</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">_img</span><span class="p">,</span> <span class="s1">&#39;yui-img&#39;</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">_img</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">);</span>
                        <span class="nx">_img</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">);</span>
                        <span class="nx">_img</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">_img</span><span class="p">,</span> <span class="s1">&#39;yui-img&#39;</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">_img</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">_img</span><span class="p">;</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="nx">exec</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_inserthtml</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;inserthtml&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_inserthtml</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;inserthtml&#39;</span><span class="p">,</span> <span class="nx">_span</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">_range</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="cm">/*</span>
<span class="cm">            * @knownissue Safari cursor position</span>
<span class="cm">            * @browser Safari 2.x</span>
<span class="cm">            * @description The issue here is that we have no way of knowing where the cursor position is</span>
<span class="cm">            * inside of the iframe, so we have to place the newly inserted data in the best place that we can.</span>
<span class="cm">            */</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">queryCommandEnabled</span><span class="p">(</span><span class="nx">action</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;More Safari DOM tricks (inserthtml)&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;EditorSafari&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">);</span>
                <span class="nx">_span</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">);</span>
                <span class="nx">_span</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">value</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">_span</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">_range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">_range</span><span class="p">.</span><span class="nx">item</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">_range</span><span class="p">.</span><span class="nx">item</span><span class="p">(</span><span class="mi">0</span><span class="p">).</span><span class="nx">outerHTML</span> <span class="o">=</span> <span class="nx">value</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">_range</span><span class="p">.</span><span class="nx">pasteHTML</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>                    
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="nx">exec</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_list</span>
<span class="cm">        * @param tag The tag of the list you want to create (eg, ul or ol)</span>
<span class="cm">        * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_list</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tag</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">list</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">li</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
                <span class="nx">selEl</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span> <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;insertorderedlist&#39;</span><span class="p">;</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">tag</span> <span class="o">==</span> <span class="s1">&#39;ul&#39;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">action</span> <span class="o">=</span> <span class="s1">&#39;insertunorderedlist&#39;</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="cm">/*</span>
<span class="cm">            * @knownissue Safari 2.+ doesn&#39;t support ordered and unordered lists</span>
<span class="cm">            * @browser Safari 2.x</span>
<span class="cm">            * The issue with this workaround is that when applied to a set of text</span>
<span class="cm">            * that has BR&#39;s in it, Safari may or may not pick up the individual items as</span>
<span class="cm">            * list items. This is fixed in WebKit (Safari 3)</span>
<span class="cm">            * 2.6.0: Seems there are still some issues with List Creation and Safari 3, reverting to previously working Safari 2.x code</span>
<span class="cm">            */</span>
            <span class="c1">//if ((this.browser.webkit &amp;&amp; !this._getDoc().queryCommandEnabled(action))) {</span>
            <span class="k">if</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit4</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">selEl</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">selEl</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">,</span> <span class="nx">tag</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;We already have a list, undo it&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="nx">selEl</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
                    <span class="nx">list</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">);</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">list</span><span class="p">,</span> <span class="s1">&#39;yui-non&#39;</span><span class="p">);</span>
                    <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                    <span class="kd">var</span> <span class="nx">lis</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">),</span> <span class="nx">p_tag</span> <span class="o">=</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;ptags&#39;</span><span class="p">))</span> <span class="o">?</span> <span class="s1">&#39;p&#39;</span> <span class="o">:</span> <span class="s1">&#39;div&#39;</span><span class="p">);</span>
                    <span class="k">for</span> <span class="p">(</span><span class="nx">li</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">li</span> <span class="o">&lt;</span> <span class="nx">lis</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">li</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">str</span> <span class="o">+=</span> <span class="s1">&#39;&lt;&#39;</span> <span class="o">+</span> <span class="nx">p_tag</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span> <span class="o">+</span> <span class="nx">lis</span><span class="p">[</span><span class="nx">li</span><span class="p">].</span><span class="nx">innerHTML</span> <span class="o">+</span> <span class="s1">&#39;&lt;/&#39;</span> <span class="o">+</span> <span class="nx">p_tag</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="nx">list</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="p">;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">list</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Create list item&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="nx">tag</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">());</span>
                    <span class="nx">list</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">tag</span><span class="p">);</span>
                    <span class="k">for</span> <span class="p">(</span><span class="nx">li</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">li</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">li</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">newli</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">);</span>
                        <span class="nx">newli</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="nx">li</span><span class="p">].</span><span class="nx">innerHTML</span> <span class="o">+</span> <span class="s1">&#39;&lt;span class=&quot;yui-non&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&#39;</span><span class="p">;</span>
                        <span class="nx">list</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">newli</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">li</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="nx">li</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="nx">li</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="kd">var</span> <span class="nx">b_tag</span> <span class="o">=</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;&lt;BR&gt;&#39;</span> <span class="o">:</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">),</span>
                    <span class="nx">items</span> <span class="o">=</span> <span class="nx">list</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="nx">b_tag</span><span class="p">),</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">item</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">items</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">list</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                        <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">items</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">item</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">);</span>
                            <span class="nx">item</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">items</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="nx">list</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">item</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">list</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">list</span><span class="p">;</span>
                    <span class="kd">var</span> <span class="nx">_h</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">firstChild</span><span class="p">;</span>
                    <span class="nx">_h</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="s1">&#39;yui-non&#39;</span><span class="p">,</span> <span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="nx">_h</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">setBaseAndExtent</span><span class="p">(</span><span class="nx">_h</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="nx">_h</span><span class="p">,</span> <span class="nx">_h</span><span class="p">.</span><span class="nx">innerText</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">tagName</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">,</span> <span class="nx">tag</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">().</span><span class="nx">parentElement</span><span class="p">,</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;ul&#39;</span><span class="p">))</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;ol&#39;</span><span class="p">)))</span> <span class="p">{</span> <span class="c1">//we are in a list..</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;We already have a list, undo it&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;ul&#39;</span><span class="p">))</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;ol&#39;</span><span class="p">)))</span> <span class="p">{</span>
                            <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
                        <span class="p">}</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Undo IE&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                        <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                        <span class="kd">var</span> <span class="nx">lis2</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">);</span>
                        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">lis2</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">str</span> <span class="o">+=</span> <span class="nx">lis2</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">innerHTML</span> <span class="o">+</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="kd">var</span> <span class="nx">newEl</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">);</span>
                        <span class="nx">newEl</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">str</span><span class="p">;</span>
                        <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">newEl</span><span class="p">,</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="nx">action</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
                    <span class="p">}</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                    <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">liso</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">);</span>
                        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">liso</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">liso</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">innerHTML</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">liso</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">liso</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">},</span><span class="mi">30</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="nx">exec</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">().</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&lt;li&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">().</span><span class="nx">html</span><span class="o">+</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">().</span><span class="nx">text</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">&#39;\n&#39;</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">t</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">ie</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">ie</span> <span class="o">&lt;</span> <span class="nx">t</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">ie</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">html</span> <span class="o">+=</span> <span class="s1">&#39;&lt;li&gt;&#39;</span> <span class="o">+</span> <span class="nx">t</span><span class="p">[</span><span class="nx">ie</span><span class="p">]</span> <span class="o">+</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">txt</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">().</span><span class="nx">text</span><span class="p">;</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">txt</span> <span class="o">===</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&lt;li id=&quot;new_list_item&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">txt</span> <span class="o">+</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="p">;</span>
                            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&lt;li&gt;&#39;</span> <span class="o">+</span> <span class="nx">txt</span> <span class="o">+</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">().</span><span class="nx">pasteHTML</span><span class="p">(</span><span class="s1">&#39;&lt;&#39;</span> <span class="o">+</span> <span class="nx">tag</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span> <span class="o">+</span> <span class="nx">html</span> <span class="o">+</span> <span class="s1">&#39;&lt;/&#39;</span> <span class="o">+</span> <span class="nx">tag</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">new_item</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">&#39;new_list_item&#39;</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">new_item</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">range</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">createTextRange</span><span class="p">();</span>
                        <span class="nx">range</span><span class="p">.</span><span class="nx">moveToElementText</span><span class="p">(</span><span class="nx">new_item</span><span class="p">);</span>
                        <span class="nx">range</span><span class="p">.</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                        <span class="nx">range</span><span class="p">.</span><span class="nx">select</span><span class="p">();</span>                       
                        <span class="nx">new_item</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">exec</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_insertorderedlist</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;insertorderedlist &#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_insertorderedlist</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">cmd_list</span><span class="p">(</span><span class="s1">&#39;ol&#39;</span><span class="p">)];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_insertunorderedlist </span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;insertunorderedlist&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_insertunorderedlist</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">cmd_list</span><span class="p">(</span><span class="s1">&#39;ul&#39;</span><span class="p">)];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_fontname</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;fontname&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_fontname</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">selEl</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">currentFont</span> <span class="o">=</span> <span class="nx">value</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">selEl</span> <span class="o">&amp;&amp;</span> <span class="nx">selEl</span><span class="p">.</span><span class="nx">tagName</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">()</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">selEl</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="nx">selEl</span><span class="p">,</span> <span class="s1">&#39;font-family&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;No selection and no selected element and we are in insert mode&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createInsertElement</span><span class="p">({</span> <span class="nx">fontFamily</span><span class="o">:</span> <span class="nx">value</span> <span class="p">});</span>
                <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="nx">exec</span><span class="p">];</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cmd_fontsize</span>
<span class="cm">        * @param value Value passed from the execCommand method</span>
<span class="cm">        * @description This is an execCommand override method. It is called from execCommand when the execCommand(&#39;fontsize&#39;) is used.</span>
<span class="cm">        */</span>
        <span class="nx">cmd_fontsize</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">go</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">==</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">{</span>
                        <span class="nx">go</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;fontSize&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">go</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span> <span class="s1">&#39;body&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">()))</span> <span class="p">{</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">();</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;fontSize&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">r</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getRange</span><span class="p">();</span>
                        <span class="nx">r</span><span class="p">.</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">false</span><span class="p">);</span>
                        <span class="nx">r</span><span class="p">.</span><span class="nx">select</span><span class="p">();</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">)))</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">,</span> <span class="s1">&#39;fontSize&#39;</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;insert&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createInsertElement</span><span class="p">({</span> <span class="nx">fontSize</span><span class="o">:</span> <span class="nx">value</span> <span class="p">});</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="p">{</span><span class="s1">&#39;fontSize&#39;</span><span class="o">:</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">fontFamily</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontFamily</span><span class="p">,</span> <span class="nx">color</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">color</span><span class="p">,</span> <span class="nx">backgroundColor</span><span class="o">:</span> <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">backgroundColor</span> <span class="p">});</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="p">[</span><span class="kc">false</span><span class="p">];</span>
        <span class="p">},</span>
    <span class="cm">/* }}} */</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _swapEl</span>
<span class="cm">        * @param {HTMLElement} el The element to swap with</span>
<span class="cm">        * @param {String} tagName The tagname of the element that you wish to create</span>
<span class="cm">        * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function.</span>
<span class="cm">        * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it&#39;s place.</span>
<span class="cm">        */</span>
        <span class="nx">_swapEl</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">tagName</span><span class="p">,</span> <span class="nx">callback</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">_el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">tagName</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">_el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">callback</span> <span class="o">==</span> <span class="s1">&#39;function&#39;</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">callback</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">_el</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">_el</span><span class="p">,</span> <span class="nx">el</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">_el</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _createInsertElement</span>
<span class="cm">        * @description Creates a new &quot;currentElement&quot; then adds some text (and other things) to make it selectable and stylable. Then the user can continue typing.</span>
<span class="cm">        * @param {Object} css (optional) Object literal containing styles to apply to the new element.</span>
<span class="cm">        * @return {HTMLElement}</span>
<span class="cm">        */</span>
        <span class="nx">_createInsertElement</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">css</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_createCurrentElement</span><span class="p">(</span><span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="nx">css</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//Little Safari Hackery here..</span>
                <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;yui-non&quot;&gt;&amp;nbsp;&lt;/span&gt;&#39;</span><span class="p">;</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">setBaseAndExtent</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="nx">el</span><span class="p">,</span> <span class="nx">el</span><span class="p">.</span><span class="nx">innerText</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>                    
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_selectNode</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="k">return</span> <span class="nx">el</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _createCurrentElement</span>
<span class="cm">        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create</span>
<span class="cm">        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.</span>
<span class="cm">        * @description This is a work around for the various browser issues with execCommand. This method will run &lt;code&gt;execCommand(&#39;fontname&#39;, false, &#39;yui-tmp&#39;)&lt;/code&gt; on the given selection.</span>
<span class="cm">        * It will then search the document for an element with the font-family set to &lt;strong&gt;yui-tmp&lt;/strong&gt; and replace that with another span that has other information in it, then assign the new span to the </span>
<span class="cm">        * &lt;code&gt;this.currentElement&lt;/code&gt; array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit.</span>
<span class="cm">        */</span>
        <span class="nx">_createCurrentElement</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tagName</span><span class="p">,</span> <span class="nx">tagStyle</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">tagName</span> <span class="o">=</span> <span class="p">((</span><span class="nx">tagName</span><span class="p">)</span> <span class="o">?</span> <span class="nx">tagName</span> <span class="o">:</span> <span class="s1">&#39;a&#39;</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="p">[],</span>
                <span class="nx">_doc</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">();</span>
            
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentFont</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">tagStyle</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">tagStyle</span> <span class="o">=</span> <span class="p">{};</span>
                <span class="p">}</span>
                <span class="nx">tagStyle</span><span class="p">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentFont</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">currentFont</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span> <span class="o">=</span> <span class="p">[];</span>

            <span class="kd">var</span> <span class="nx">_elCreate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tagName</span><span class="p">,</span> <span class="nx">tagStyle</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                <span class="nx">tagName</span> <span class="o">=</span> <span class="p">((</span><span class="nx">tagName</span><span class="p">)</span> <span class="o">?</span> <span class="nx">tagName</span> <span class="o">:</span> <span class="s1">&#39;span&#39;</span><span class="p">);</span>
                <span class="nx">tagName</span> <span class="o">=</span> <span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
                <span class="k">switch</span> <span class="p">(</span><span class="nx">tagName</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">case</span> <span class="s1">&#39;h1&#39;</span><span class="o">:</span>
                    <span class="k">case</span> <span class="s1">&#39;h2&#39;</span><span class="o">:</span>
                    <span class="k">case</span> <span class="s1">&#39;h3&#39;</span><span class="o">:</span>
                    <span class="k">case</span> <span class="s1">&#39;h4&#39;</span><span class="o">:</span>
                    <span class="k">case</span> <span class="s1">&#39;h5&#39;</span><span class="o">:</span>
                    <span class="k">case</span> <span class="s1">&#39;h6&#39;</span><span class="o">:</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="nx">_doc</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">tagName</span><span class="p">);</span>
                        <span class="k">break</span><span class="p">;</span>
                    <span class="k">default</span><span class="o">:</span>
                        <span class="nx">el</span> <span class="o">=</span> <span class="nx">_doc</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">tagName</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">tagName</span> <span class="o">===</span> <span class="s1">&#39;span&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;yui-tag-&#39;</span> <span class="o">+</span> <span class="nx">tagName</span><span class="p">);</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s1">&#39;yui-tag&#39;</span><span class="p">);</span>
                            <span class="nx">el</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s1">&#39;tag&#39;</span><span class="p">,</span> <span class="nx">tagName</span><span class="p">);</span>
                        <span class="p">}</span>

                        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">k</span> <span class="k">in</span> <span class="nx">tagStyle</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">tagStyle</span><span class="p">,</span> <span class="nx">k</span><span class="p">))</span> <span class="p">{</span>
                                <span class="nx">el</span><span class="p">.</span><span class="nx">style</span><span class="p">[</span><span class="nx">k</span><span class="p">]</span> <span class="o">=</span> <span class="nx">tagStyle</span><span class="p">[</span><span class="nx">k</span><span class="p">];</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">return</span> <span class="nx">el</span><span class="p">;</span>
            <span class="p">};</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasSelection</span><span class="p">())</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">queryCommandEnabled</span><span class="p">(</span><span class="s1">&#39;insertimage&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;insertimage&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="s1">&#39;yui-tmp-img&#39;</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">imgs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">);</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">imgs</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">imgs</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">getAttribute</span><span class="p">(</span><span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;yui-tmp-img&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">el</span> <span class="o">=</span> <span class="nx">_elCreate</span><span class="p">(</span><span class="nx">tagName</span><span class="p">,</span> <span class="nx">tagStyle</span><span class="p">);</span>
                            <span class="nx">imgs</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">imgs</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">tar</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="c1">//For Safari..</span>
                        <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">;</span>                        
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">tar</span><span class="p">)</span> <span class="p">{</span>
                    <span class="cm">/*</span>
<span class="cm">                    * @knownissue Safari Cursor Position</span>
<span class="cm">                    * @browser Safari 2.x</span>
<span class="cm">                    * @description The issue here is that we have no way of knowing where the cursor position is</span>
<span class="cm">                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.</span>
<span class="cm">                    */</span>
                    <span class="nx">el</span> <span class="o">=</span> <span class="nx">_elCreate</span><span class="p">(</span><span class="nx">tagName</span><span class="p">,</span> <span class="nx">tagStyle</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;body&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;html&#39;</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">tar</span><span class="p">,</span> <span class="s1">&#39;html&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">tar</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="nx">tar</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">tar</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">tar</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">tar</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">tar</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="c1">//this.currentElement = el;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">//Force Safari to focus the new element</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">setBaseAndExtent</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">el</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">collapseToStart</span><span class="p">();</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="c1">//Force CSS Styling for this action...</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_setEditorStyle</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">execCommand</span><span class="p">(</span><span class="s1">&#39;fontname&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">,</span> <span class="s1">&#39;yui-tmp&#39;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">_tmp</span> <span class="o">=</span> <span class="p">[],</span> <span class="nx">__tmp</span><span class="p">,</span> <span class="nx">__els</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;font&#39;</span><span class="p">,</span> <span class="s1">&#39;span&#39;</span><span class="p">,</span> <span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="s1">&#39;b&#39;</span><span class="p">,</span> <span class="s1">&#39;u&#39;</span><span class="p">];</span>

                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">(),</span> <span class="s1">&#39;body&#39;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">__els</span><span class="p">[</span><span class="nx">__els</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">().</span><span class="nx">tagName</span><span class="p">);</span>
                    <span class="nx">__els</span><span class="p">[</span><span class="nx">__els</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_getSelectedElement</span><span class="p">().</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">tagName</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">_els</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">_els</span> <span class="o">&lt;</span> <span class="nx">__els</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">_els</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">_tmp1</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="nx">__els</span><span class="p">[</span><span class="nx">_els</span><span class="p">]);</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">e</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">e</span> <span class="o">&lt;</span> <span class="nx">_tmp1</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">e</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">_tmp</span><span class="p">[</span><span class="nx">_tmp</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">_tmp1</span><span class="p">[</span><span class="nx">e</span><span class="p">];</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">_tmp</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">((</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;font-family&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;yui-tmp&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">face</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">face</span> <span class="o">==</span> <span class="s1">&#39;yui-tmp&#39;</span><span class="p">)))</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">tagName</span> <span class="o">!==</span> <span class="s1">&#39;span&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">el</span> <span class="o">=</span> <span class="nx">_elCreate</span><span class="p">(</span><span class="nx">tagName</span><span class="p">,</span> <span class="nx">tagStyle</span><span class="p">);</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">el</span> <span class="o">=</span> <span class="nx">_elCreate</span><span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">tagName</span><span class="p">,</span> <span class="nx">tagStyle</span><span class="p">);</span>
                        <span class="p">}</span>
                        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">innerHTML</span><span class="p">;</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;ol&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;ul&#39;</span><span class="p">)))</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">fc</span> <span class="o">=</span> <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;li&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
                            <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="s1">&#39;inherit&#39;</span><span class="p">;</span>
                            <span class="nx">fc</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="s1">&#39;inherit&#39;</span><span class="p">;</span>
                            <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">fc</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">;</span>
                            <span class="nx">fc</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                            <span class="nx">fc</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="s1">&#39;li&#39;</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
                            <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
                            <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">fontFamily</span> <span class="o">=</span> <span class="s1">&#39;inherit&#39;</span><span class="p">;</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">_tmp</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">currentEvent</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="c1">//Force Safari to focus the new element</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">setBaseAndExtent</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">el</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit3</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">collapseToStart</span><span class="p">();</span>
                                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">collapse</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="nx">tagStyle</span> <span class="o">&amp;&amp;</span> <span class="nx">tagStyle</span><span class="p">.</span><span class="nx">fontSize</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">empty</span><span class="p">();</span>
                                <span class="p">}</span>
                                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">gecko</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_getSelection</span><span class="p">().</span><span class="nx">collapseToStart</span><span class="p">();</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="kd">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">o</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">o</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="p">;</span> <span class="nx">o</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">((</span><span class="nx">o</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">!=</span> <span class="nx">len</span><span class="p">)</span> <span class="p">{</span> <span class="c1">//Skip the last one in the list</span>
                        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="nx">o</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="nx">o</span><span class="p">].</span><span class="nx">nextSibling</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isElement</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="nx">o</span><span class="p">],</span> <span class="s1">&#39;br&#39;</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">currentElement</span><span class="p">[</span><span class="nx">o</span><span class="p">].</span><span class="nx">nextSibling</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method saveHTML</span>
<span class="cm">        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.</span>
<span class="cm">        * @return String</span>
<span class="cm">        */</span>
        <span class="nx">saveHTML</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">cleanHTML</span><span class="p">();</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_textarea</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">html</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">html</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;saveEl&#39;</span><span class="p">)</span> <span class="o">!==</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">out</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;saveEl&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">out</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">out</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">out</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">out</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">out</span><span class="p">.</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">===</span> <span class="s1">&#39;textarea&#39;</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">out</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">html</span><span class="p">;</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">out</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">html</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method setEditorHTML</span>
<span class="cm">        * @param {String} incomingHTML The html content to load into the editor</span>
<span class="cm">        * @description Loads HTML into the editors body</span>
<span class="cm">        */</span>
        <span class="nx">setEditorHTML</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">incomingHTML</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_cleanIncomingHTML</span><span class="p">(</span><span class="nx">incomingHTML</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/RIGHT_BRACKET/gi</span><span class="p">,</span> <span class="s1">&#39;{&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/LEFT_BRACKET/gi</span><span class="p">,</span> <span class="s1">&#39;}&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">html</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">nodeChange</span><span class="p">();</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method getEditorHTML</span>
<span class="cm">        * @description Gets the unprocessed/unfiltered HTML from the editor</span>
<span class="cm">        */</span>
        <span class="nx">getEditorHTML</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">try</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">;</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">b</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Body is null, returning null.&#39;</span><span class="p">,</span> <span class="s1">&#39;error&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">;</span>
            <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method show</span>
<span class="cm">        * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none.</span>
<span class="cm">        */</span>
        <span class="nx">show</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">gecko</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_setDesignMode</span><span class="p">(</span><span class="s1">&#39;on&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                <span class="nb">window</span><span class="p">.</span><span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_setInitialContent</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">);</span>
                <span class="p">},</span> <span class="mi">10</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="c1">//Adding this will close all other Editor window&#39;s when showing this one.</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="c1">//Put the iframe back in place</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;static&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method hide</span>
<span class="cm">        * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows.</span>
<span class="cm">        */</span>
        <span class="nx">hide</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="c1">//Adding this will close all other Editor window&#39;s.</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">currentWindow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">closeWindow</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_fixNodesTimer</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">clearTimeout</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_fixNodesTimer</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_fixNodesTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeTimer</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">clearTimeout</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeTimer</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_lastNodeChange</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="c1">//Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements.</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;absolute&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;iframe&#39;</span><span class="p">).</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;-9999px&#39;</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method _cleanIncomingHTML</span>
<span class="cm">        * @param {String} html The unfiltered HTML</span>
<span class="cm">        * @description Process the HTML with a few regexes to clean it up and stabilize the input</span>
<span class="cm">        * @return {String} The filtered HTML</span>
<span class="cm">        */</span>
        <span class="nx">_cleanIncomingHTML</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/{/gi</span><span class="p">,</span> <span class="s1">&#39;RIGHT_BRACKET&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/}/gi</span><span class="p">,</span> <span class="s1">&#39;LEFT_BRACKET&#39;</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;strong([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;b$1&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/strong&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/b&gt;&#39;</span><span class="p">);</span>   

            <span class="c1">//replace embed before em check</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;embed([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_EMBED$1&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/embed&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/YUI_EMBED&gt;&#39;</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;em([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;i$1&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/em&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/i&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/_moz_dirty=&quot;&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            
            <span class="c1">//Put embed tags back in..</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_EMBED([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;embed$1&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/YUI_EMBED&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/embed&gt;&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;plainText&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Filtering as plain text&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\n/g</span><span class="p">,</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\r/g</span><span class="p">,</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/  /gi</span><span class="p">,</span> <span class="s1">&#39;&amp;nbsp;&amp;nbsp;&#39;</span><span class="p">);</span> <span class="c1">//Replace all double spaces</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\t/gi</span><span class="p">,</span> <span class="s1">&#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;</span><span class="p">);</span> <span class="c1">//Replace all tabs</span>
            <span class="p">}</span>
            <span class="c1">//Removing Script Tags from the Editor</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;script([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;bad&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/script([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/bad&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&amp;lt;script([^&gt;]*)&amp;gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;bad&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&amp;lt;\/script([^&gt;]*)&amp;gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/bad&gt;&#39;</span><span class="p">);</span>
            <span class="c1">//Replace the line feeds</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\r\n/g</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_LF&gt;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\n/g</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_LF&gt;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\r/g</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_LF&gt;&#39;</span><span class="p">);</span>
            
            <span class="c1">//Remove Bad HTML elements (used to be script nodes)</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s1">&#39;&lt;bad([^&gt;]*)&gt;(.*?)&lt;\/bad&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;gi&#39;</span><span class="p">),</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="c1">//Replace the lines feeds</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_LF&gt;/g</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span><span class="p">);</span>
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method cleanHTML</span>
<span class="cm">        * @param {String} html The unfiltered HTML</span>
<span class="cm">        * @description Process the HTML with a few regexes to clean it up and stabilize the output</span>
<span class="cm">        * @return {String} The filtered HTML</span>
<span class="cm">        */</span>
        <span class="nx">cleanHTML</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">//Start Filtering Output</span>
            <span class="c1">//Begin RegExs..</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span> 
                <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getEditorHTML</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="kd">var</span> <span class="nx">markup</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;markup&#39;</span><span class="p">);</span>
            <span class="c1">//Make some backups...</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">pre_filter_linebreaks</span><span class="p">(</span><span class="nx">html</span><span class="p">,</span> <span class="nx">markup</span><span class="p">);</span>

            <span class="c1">//Filter MS Word</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter_msword</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;img([^&gt;]*)\/&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_IMG$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;img([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_IMG$1&gt;&#39;</span><span class="p">);</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;input([^&gt;]*)\/&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_INPUT$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;input([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_INPUT$1&gt;&#39;</span><span class="p">);</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;ul([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_UL$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/ul&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;\/YUI_UL&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;blockquote([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BQ$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/blockquote&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;\/YUI_BQ&gt;&#39;</span><span class="p">);</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;embed([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_EMBED$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/embed&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;\/YUI_EMBED&gt;&#39;</span><span class="p">);</span>

            <span class="c1">//Convert b and i tags to strong and em tags</span>
            <span class="k">if</span> <span class="p">((</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;semantic&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//html = html.replace(/&lt;i(\s+[^&gt;]*)?&gt;/gi, &quot;&lt;em$1&gt;&quot;);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;i([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;em$1&gt;&quot;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/i&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/em&gt;&#39;</span><span class="p">);</span>
                <span class="c1">//html = html.replace(/&lt;b(\s+[^&gt;]*)?&gt;/gi, &quot;&lt;strong$1&gt;&quot;);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;b([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;strong$1&gt;&quot;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/b&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/strong&gt;&#39;</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/_moz_dirty=&quot;&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>

            <span class="c1">//normalize strikethrough</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;strike/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;span style=&quot;text-decoration: line-through;&quot;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\/strike&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;/span&gt;&#39;</span><span class="p">);</span>
            
            
            <span class="c1">//Case Changing</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/text-decoration/gi</span><span class="p">,</span> <span class="s1">&#39;text-decoration&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/font-weight/gi</span><span class="p">,</span> <span class="s1">&#39;font-weight&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/_width=&quot;([^&gt;]*)&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/_height=&quot;([^&gt;]*)&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="c1">//Cleanup Image URL&#39;s</span>
                <span class="kd">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_baseHREF</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\//gi</span><span class="p">,</span> <span class="s1">&#39;\\/&#39;</span><span class="p">),</span>
                    <span class="nx">re</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s1">&#39;src=&quot;&#39;</span> <span class="o">+</span> <span class="nx">url</span><span class="p">,</span> <span class="s1">&#39;gi&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="nx">re</span><span class="p">,</span> <span class="s1">&#39;src=&quot;&#39;</span><span class="p">);</span>
            <span class="p">}</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;font/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;font&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/font&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/font&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;span/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;span&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/span&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">((</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;semantic&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;css&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s1">&#39;&lt;font([^&gt;]*)face=&quot;([^&gt;]*)&quot;&gt;(.*?)&lt;\/font&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;gi&#39;</span><span class="p">),</span> <span class="s1">&#39;&lt;span $1 style=&quot;font-family: $2;&quot;&gt;$3&lt;/span&gt;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;u/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;span style=&quot;text-decoration: underline;&quot;&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s1">&#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;([^&gt;]*)&lt;\/span&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;gi&#39;</span><span class="p">),</span> <span class="s1">&#39;&lt;strong&gt;$1&lt;/strong&gt;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s1">&#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: italic;&quot;&gt;([^&gt;]*)&lt;\/span&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;gi&#39;</span><span class="p">),</span> <span class="s1">&#39;&lt;em&gt;$1&lt;/em&gt;&#39;</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\/u&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;/span&gt;&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;css&#39;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;em([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;i$1&gt;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/em&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/i&gt;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;strong([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;b$1&gt;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/strong&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/b&gt;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;b/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;span style=&quot;font-weight: bold;&quot;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\/b&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;/span&gt;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;i/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;span style=&quot;font-style: italic;&quot;&#39;</span><span class="p">);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\/i&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;/span&gt;&#39;</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/  /gi</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">);</span> <span class="c1">//Replace all double spaces and replace with a single</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;u/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;u&#39;</span><span class="p">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\/u&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;/u&gt;&#39;</span><span class="p">);</span>
            <span class="p">}</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;ol([^&gt;]*)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;ol$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\/ol&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;/ol&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;li/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;li&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\/li&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;/li&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter_safari</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter_internals</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter_all_rgb</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>

            <span class="c1">//Replace our backups with the real thing</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">post_filter_linebreaks</span><span class="p">(</span><span class="nx">html</span><span class="p">,</span> <span class="nx">markup</span><span class="p">);</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="p">)</span> <span class="p">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_IMG([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;img $1 /&gt;&#39;</span><span class="p">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_INPUT([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;input $1 /&gt;&#39;</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_IMG([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;img $1&gt;&#39;</span><span class="p">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_INPUT([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;input $1&gt;&#39;</span><span class="p">);</span>
            <span class="p">}</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_UL([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;ul$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/YUI_UL&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;\/ul&gt;&#39;</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter_invalid_lists</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_BQ([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;blockquote$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/YUI_BQ&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;\/blockquote&gt;&#39;</span><span class="p">);</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_EMBED([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;embed$1&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/YUI_EMBED&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;\/embed&gt;&#39;</span><span class="p">);</span>
            
            <span class="c1">//This should fix &amp;amp;&#39;s in URL&#39;s</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ &amp;amp; /gi</span><span class="p">,</span> <span class="s1">&#39; YUI_AMP &#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ &amp;amp;/gi</span><span class="p">,</span> <span class="s1">&#39; YUI_AMP_F &#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&amp;amp; /gi</span><span class="p">,</span> <span class="s1">&#39; YUI_AMP_R &#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&amp;amp;/gi</span><span class="p">,</span> <span class="s1">&#39;&amp;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ YUI_AMP /gi</span><span class="p">,</span> <span class="s1">&#39; &amp;amp; &#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ YUI_AMP_F /gi</span><span class="p">,</span> <span class="s1">&#39; &amp;amp;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ YUI_AMP_R /gi</span><span class="p">,</span> <span class="s1">&#39;&amp;amp; &#39;</span><span class="p">);</span>

            <span class="c1">//Trim the output, removing whitespace from the beginning and end</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">trim</span><span class="p">(</span><span class="nx">html</span><span class="p">);</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;removeLineBreaks&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\n/g</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\r/g</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/  /gi</span><span class="p">,</span> <span class="s1">&#39; &#39;</span><span class="p">);</span> <span class="c1">//Replace all double spaces and replace with a single</span>
            <span class="p">}</span>
            
            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">v</span> <span class="k">in</span> <span class="k">this</span><span class="p">.</span><span class="nx">invalidHTML</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">invalidHTML</span><span class="p">,</span> <span class="nx">v</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">v</span><span class="p">.</span><span class="nx">keepContents</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s1">&#39;&lt;&#39;</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">+</span> <span class="s1">&#39;([^&gt;]*)&gt;(.*?)&lt;\/&#39;</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;gi&#39;</span><span class="p">),</span> <span class="s1">&#39;$1&#39;</span><span class="p">);</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s1">&#39;&lt;&#39;</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">+</span> <span class="s1">&#39;([^&gt;]*)&gt;(.*?)&lt;\/&#39;</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">+</span> <span class="s1">&#39;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;gi&#39;</span><span class="p">),</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="cm">/* LATER -- Add DOM manipulation</span>
<span class="cm">            console.log(html);</span>
<span class="cm">            var frag = document.createDocumentFragment();</span>
<span class="cm">            frag.innerHTML = html;</span>

<span class="cm">            var ps = frag.getElementsByTagName(&#39;p&#39;),</span>
<span class="cm">                len = ps.length;</span>
<span class="cm">            for (var i = 0; i &lt; len; i++) {</span>
<span class="cm">                var ps2 = ps[i].getElementsByTagName(&#39;p&#39;);</span>
<span class="cm">                if (ps2.length) {</span>
<span class="cm">                    </span>
<span class="cm">                }</span>
<span class="cm">                </span>
<span class="cm">            }</span>
<span class="cm">            html = frag.innerHTML;</span>
<span class="cm">            console.log(html);</span>
<span class="cm">            */</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s1">&#39;cleanHTML&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;cleanHTML&#39;</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span> <span class="nx">html</span><span class="o">:</span> <span class="nx">html</span> <span class="p">});</span>

            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method filter_msword</span>
<span class="cm">        * @param String html The HTML string to filter</span>
<span class="cm">        * @description Filters out msword html attributes and other junk. Activate with filterWord: true in config</span>
<span class="cm">        */</span>
        <span class="nx">filter_msword</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;filterWord&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="c1">//Remove the ms o: tags</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;o:p&gt;\s*&lt;\/o:p&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;o:p&gt;[\s\S]*?&lt;\/o:p&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">);</span>

            <span class="c1">//Remove the ms w: tags</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/&lt;w:[^&gt;]*&gt;[\s\S]*?&lt;\/w:[^&gt;]*&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>

            <span class="c1">//Remove mso-? styles.</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*mso-[^:]+:[^;&quot;]+;?/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>

            <span class="c1">//Remove more bogus MS styles.</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*MARGIN: 0cm 0cm 0pt\s*;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*MARGIN: 0cm 0cm 0pt\s*&quot;/gi</span><span class="p">,</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*TEXT-INDENT: 0cm\s*;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*TEXT-INDENT: 0cm\s*&quot;/gi</span><span class="p">,</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*PAGE-BREAK-BEFORE: [^\s;]+;?&quot;/gi</span><span class="p">,</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*FONT-VARIANT: [^\s;]+;?&quot;/gi</span><span class="p">,</span> <span class="s2">&quot;\&quot;&quot;</span> <span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*tab-stops:[^;&quot;]*;?/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/\s*tab-stops:[^&quot;]*/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>

            <span class="c1">//Remove XML declarations</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\\?\?xml[^&gt;]*&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>

            <span class="c1">//Remove lang</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;(\w[^&gt;]*) lang=([^ |&gt;]*)([^&gt;]*)/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;$1$3&quot;</span><span class="p">);</span>

            <span class="c1">//Remove language tags</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/&lt;(\w[^&gt;]*) language=([^ |&gt;]*)([^&gt;]*)/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;$1$3&quot;</span><span class="p">);</span>

            <span class="c1">//Remove onmouseover and onmouseout events (from MS Word comments effect)</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/&lt;(\w[^&gt;]*) onmouseover=&quot;([^\&quot;]*)&quot;([^&gt;]*)/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;$1$3&quot;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span> <span class="sr">/&lt;(\w[^&gt;]*) onmouseout=&quot;([^\&quot;]*)&quot;([^&gt;]*)/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;$1$3&quot;</span><span class="p">);</span>
            
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method filter_invalid_lists</span>
<span class="cm">        * @param String html The HTML string to filter</span>
<span class="cm">        * @description Filters invalid ol and ul list markup, converts this: &lt;li&gt;&lt;/li&gt;&lt;ol&gt;..&lt;/ol&gt; to this: &lt;li&gt;&lt;/li&gt;&lt;li&gt;&lt;ol&gt;..&lt;/ol&gt;&lt;/li&gt;</span>
<span class="cm">        */</span>
        <span class="nx">filter_invalid_lists</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/li&gt;\n/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/li&gt;&lt;ol&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/li&gt;&lt;li&gt;&lt;ol&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/ol&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/ol&gt;&lt;/li&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/ol&gt;&lt;\/li&gt;\n/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;/ol&gt;&quot;</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/li&gt;&lt;ul&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/li&gt;&lt;li&gt;&lt;ul&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/ul&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/ul&gt;&lt;/li&gt;&#39;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/ul&gt;&lt;\/li&gt;\n?/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;/ul&gt;&quot;</span><span class="p">);</span>

            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/li&gt;/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;/li&gt;&quot;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/ol&gt;/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;/ol&gt;&quot;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;ol&gt;/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;ol&gt;&quot;</span><span class="p">);</span>
            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;ul&gt;/gi</span><span class="p">,</span> <span class="s2">&quot;&lt;ul&gt;&quot;</span><span class="p">);</span>
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method filter_safari</span>
<span class="cm">        * @param String html The HTML string to filter</span>
<span class="cm">        * @description Filters strings specific to Safari</span>
<span class="cm">        * @return String</span>
<span class="cm">        */</span>
        <span class="nx">filter_safari</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;([^&gt;])&lt;\/span&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/Apple-style-span/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/style=&quot;line-height: normal;&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/yui-wk-div/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/yui-wk-p/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>


                <span class="c1">//Remove bogus LI&#39;s</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;li&gt;&lt;\/li&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;li&gt; &lt;\/li&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;li&gt;  &lt;\/li&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="c1">//Remove bogus DIV&#39;s - updated from just removing the div&#39;s to replacing /div with a break</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;ptags&#39;</span><span class="p">))</span> <span class="p">{</span>
		            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;div([^&gt;]*)&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;p$1&gt;&#39;</span><span class="p">);</span>
				    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/div&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/p&gt;&#39;</span><span class="p">);</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">//html = html.replace(/&lt;div&gt;/gi, &#39;&lt;br&gt;&#39;);</span>
                    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;div([^&gt;]*)&gt;([ tnr]*)&lt;\/div&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">);</span>
				    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/div&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method filter_internals</span>
<span class="cm">        * @param String html The HTML string to filter</span>
<span class="cm">        * @description Filters internal RTE strings and bogus attrs we don&#39;t want</span>
<span class="cm">        * @return String</span>
<span class="cm">        */</span>
        <span class="nx">filter_internals</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">)</span> <span class="p">{</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\r/g</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="c1">//Fix stuff we don&#39;t want</span>
	        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;\/?(body|head|html)[^&gt;]*&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="c1">//Fix last BR in LI</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_BR&gt;&lt;\/li&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="p">);</span>

		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/yui-tag-span/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/yui-tag/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/yui-non/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/yui-img/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ tag=&quot;span&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ class=&quot;&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ style=&quot;&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ class=&quot; &quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ class=&quot;  &quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ target=&quot;&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ title=&quot;&quot;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ class= /gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/ class= &gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method filter_all_rgb</span>
<span class="cm">        * @param String str The HTML string to filter</span>
<span class="cm">        * @description Converts all RGB color strings found in passed string to a hex color, example: style=&quot;color: rgb(0, 255, 0)&quot; converts to style=&quot;color: #00ff00&quot;</span>
<span class="cm">        * @return String</span>
<span class="cm">        */</span>
        <span class="nx">filter_all_rgb</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">str</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">exp</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">&quot;rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)&quot;</span><span class="p">,</span> <span class="s2">&quot;gi&quot;</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">arr</span> <span class="o">=</span> <span class="nx">str</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="nx">exp</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">arr</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">arr</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">color</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter_rgb</span><span class="p">(</span><span class="nx">arr</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                    <span class="nx">str</span> <span class="o">=</span> <span class="nx">str</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="nx">arr</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">toString</span><span class="p">(),</span> <span class="nx">color</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            
            <span class="k">return</span> <span class="nx">str</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method filter_rgb</span>
<span class="cm">        * @param String css The CSS string containing rgb(#,#,#);</span>
<span class="cm">        * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00</span>
<span class="cm">        * @return String</span>
<span class="cm">        */</span>
        <span class="nx">filter_rgb</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">css</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">css</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;rgb&#39;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">exp</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">&quot;(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)&quot;</span><span class="p">,</span> <span class="s2">&quot;gi&quot;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">rgb</span> <span class="o">=</span> <span class="nx">css</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="nx">exp</span><span class="p">,</span> <span class="s2">&quot;$1,$2,$3,$4,$5&quot;</span><span class="p">).</span><span class="nx">split</span><span class="p">(</span><span class="s1">&#39;,&#39;</span><span class="p">);</span>
            
                <span class="k">if</span> <span class="p">(</span><span class="nx">rgb</span><span class="p">.</span><span class="nx">length</span> <span class="o">==</span> <span class="mi">5</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">r</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">rgb</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="mi">10</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">g</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">rgb</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="mi">10</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">);</span>
                    <span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">rgb</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="mi">10</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">);</span>

                    <span class="nx">r</span> <span class="o">=</span> <span class="nx">r</span><span class="p">.</span><span class="nx">length</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">?</span> <span class="s1">&#39;0&#39;</span> <span class="o">+</span> <span class="nx">r</span> <span class="o">:</span> <span class="nx">r</span><span class="p">;</span>
                    <span class="nx">g</span> <span class="o">=</span> <span class="nx">g</span><span class="p">.</span><span class="nx">length</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">?</span> <span class="s1">&#39;0&#39;</span> <span class="o">+</span> <span class="nx">g</span> <span class="o">:</span> <span class="nx">g</span><span class="p">;</span>
                    <span class="nx">b</span> <span class="o">=</span> <span class="nx">b</span><span class="p">.</span><span class="nx">length</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">?</span> <span class="s1">&#39;0&#39;</span> <span class="o">+</span> <span class="nx">b</span> <span class="o">:</span> <span class="nx">b</span><span class="p">;</span>

                    <span class="nx">css</span> <span class="o">=</span> <span class="s2">&quot;#&quot;</span> <span class="o">+</span> <span class="nx">r</span> <span class="o">+</span> <span class="nx">g</span> <span class="o">+</span> <span class="nx">b</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">css</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method pre_filter_linebreaks</span>
<span class="cm">        * @param String html The HTML to filter</span>
<span class="cm">        * @param String markup The markup type to filter to</span>
<span class="cm">        * @description HTML Pre Filter</span>
<span class="cm">        * @return String</span>
<span class="cm">        */</span>
        <span class="nx">pre_filter_linebreaks</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">,</span> <span class="nx">markup</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="p">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;br class=&quot;khtml-block-placeholder&quot;&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;br class=&quot;webkit-block-placeholder&quot;&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
            <span class="p">}</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;br&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;br (.*?)&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;br\/&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;br \/&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;div&gt;&lt;YUI_BR&gt;&lt;\/div&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;p&gt;(&amp;nbsp;|&amp;#160;)&lt;\/p&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>            
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;p&gt;&lt;br&gt;&amp;nbsp;&lt;\/p&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
		    <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;p&gt;&amp;nbsp;&lt;\/p&gt;/gi</span><span class="p">,</span> <span class="s1">&#39;&lt;YUI_BR&gt;&#39;</span><span class="p">);</span>
            <span class="c1">//Fix last BR</span>
	        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_BR&gt;$/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="c1">//Fix last BR in P</span>
	        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_BR&gt;&lt;\/p&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;/p&gt;&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">browser</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
	            <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/g</span><span class="p">,</span> <span class="s1">&#39;\t&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method post_filter_linebreaks</span>
<span class="cm">        * @param String html The HTML to filter</span>
<span class="cm">        * @param String markup The markup type to filter to</span>
<span class="cm">        * @description HTML Pre Filter</span>
<span class="cm">        * @return String</span>
<span class="cm">        */</span>
        <span class="nx">post_filter_linebreaks</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">html</span><span class="p">,</span> <span class="nx">markup</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">markup</span> <span class="o">==</span> <span class="s1">&#39;xhtml&#39;</span><span class="p">)</span> <span class="p">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_BR&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;br /&gt;&#39;</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
		        <span class="nx">html</span> <span class="o">=</span> <span class="nx">html</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/&lt;YUI_BR&gt;/g</span><span class="p">,</span> <span class="s1">&#39;&lt;br&gt;&#39;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">html</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method clearEditorDoc</span>
<span class="cm">        * @description Clear the doc of the Editor</span>
<span class="cm">        */</span>
        <span class="nx">clearEditorDoc</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_getDoc</span><span class="p">().</span><span class="nx">body</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&amp;nbsp;&#39;</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method openWindow</span>
<span class="cm">        * @description Override Method for Advanced Editor</span>
<span class="cm">        */</span>
        <span class="nx">openWindow</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method moveWindow</span>
<span class="cm">        * @description Override Method for Advanced Editor</span>
<span class="cm">        */</span>
        <span class="nx">moveWindow</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @private</span>
<span class="cm">        * @method _closeWindow</span>
<span class="cm">        * @description Override Method for Advanced Editor</span>
<span class="cm">        */</span>
        <span class="nx">_closeWindow</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method closeWindow</span>
<span class="cm">        * @description Override Method for Advanced Editor</span>
<span class="cm">        */</span>
        <span class="nx">closeWindow</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="c1">//this.unsubscribeAll(&#39;afterExecCommand&#39;);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">resetAllButtons</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>        
        <span class="p">},</span>
        <span class="cm">/**</span>
<span class="cm">        * @method destroy</span>
<span class="cm">        * @description Destroys the editor, all of it&#39;s elements and objects.</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">destroy</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeDelayTimer</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">clearTimeout</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_nodeChangeDelayTimer</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">hide</span><span class="p">();</span>
        
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Destroying Editor&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">resize</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Destroying Resize&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">resize</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dd</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Unreg DragDrop Instance&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">dd</span><span class="p">.</span><span class="nx">unreg</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;panel&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Destroying Editor Panel&#39;</span><span class="p">,</span> <span class="s1">&#39;warn&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;panel&#39;</span><span class="p">).</span><span class="nx">destroy</span><span class="p">();</span>
            <span class="p">}</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">saveHTML</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">toolbar</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Restoring TextArea&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;visibility&#39;</span><span class="p">,</span> <span class="s1">&#39;visible&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;position&#39;</span><span class="p">,</span> <span class="s1">&#39;static&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;top&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setStyle</span><span class="p">(</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">textArea</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;parentNode&#39;</span><span class="p">).</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">textArea</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">));</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;handleSubmit&#39;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span> <span class="c1">//Remove the submit handler</span>
            <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
        <span class="p">},</span>        
        <span class="cm">/**</span>
<span class="cm">        * @method toString</span>
<span class="cm">        * @description Returns a string representing the editor.</span>
<span class="cm">        * @return {String}</span>
<span class="cm">        */</span>
        <span class="nx">toString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;SimpleEditor&#39;</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">str</span> <span class="o">=</span> <span class="s1">&#39;SimpleEditor (#&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element_cont&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;id&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span> <span class="o">+</span> <span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39; Disabled&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="p">));</span>
            <span class="p">}</span>
            <span class="k">return</span> <span class="nx">str</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">});</span>

<span class="cm">/**</span>
<span class="cm">* @event toolbarLoaded</span>
<span class="cm">* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event cleanHTML</span>
<span class="cm">* @description Event is fired after the cleanHTML method is called.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event afterRender</span>
<span class="cm">* @description Event is fired after the render process finishes. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorContentLoaded</span>
<span class="cm">* @description Event is fired after the editor iframe&#39;s document fully loads and fires it&#39;s onload event. From here you can start injecting your own things into the document. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeNodeChange</span>
<span class="cm">* @description Event fires at the beginning of the nodeChange process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event afterNodeChange</span>
<span class="cm">* @description Event fires at the end of the nodeChange process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeExecCommand</span>
<span class="cm">* @description Event fires at the beginning of the execCommand process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event afterExecCommand</span>
<span class="cm">* @description Event fires at the end of the execCommand process. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorMouseUp</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorMouseDown</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorDoubleClick</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorClick</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorKeyUp</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorKeyPress</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorKeyDown</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Passed through HTML Event. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeEditorMouseUp</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Fires before editor event, returning false will stop the internal processing.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeEditorMouseDown</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Fires before editor event, returning false will stop the internal processing.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeEditorDoubleClick</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Fires before editor event, returning false will stop the internal processing.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeEditorClick</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Fires before editor event, returning false will stop the internal processing.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeEditorKeyUp</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Fires before editor event, returning false will stop the internal processing.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeEditorKeyPress</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Fires before editor event, returning false will stop the internal processing.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event beforeEditorKeyDown</span>
<span class="cm">* @param {Event} ev The DOM Event that occured</span>
<span class="cm">* @description Fires before editor event, returning false will stop the internal processing.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>

<span class="cm">/**</span>
<span class="cm">* @event editorWindowFocus</span>
<span class="cm">* @description Fires when the iframe is focused. Note, this is window focus event, not an Editor focus event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>
<span class="cm">/**</span>
<span class="cm">* @event editorWindowBlur</span>
<span class="cm">* @description Fires when the iframe is blurred. Note, this is window blur event, not an Editor blur event.</span>
<span class="cm">* @type YAHOO.util.CustomEvent</span>
<span class="cm">*/</span>


<span class="cm">/**</span>
<span class="cm"> * @description Singleton object used to track the open window objects and panels across the various open editors</span>
<span class="cm"> * @class EditorInfo</span>
<span class="cm"> * @static</span>
<span class="cm">*/</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">EditorInfo</span> <span class="o">=</span> <span class="p">{</span>
    <span class="cm">/**</span>
<span class="cm">    * @private</span>
<span class="cm">    * @property _instances</span>
<span class="cm">    * @description A reference to all editors on the page.</span>
<span class="cm">    * @type Object</span>
<span class="cm">    */</span>
    <span class="nx">_instances</span><span class="o">:</span> <span class="p">{},</span>
    <span class="cm">/**</span>
<span class="cm">    * @private</span>
<span class="cm">    * @property blankImage</span>
<span class="cm">    * @description A reference to the blankImage url</span>
<span class="cm">    * @type String </span>
<span class="cm">    */</span>
    <span class="nx">blankImage</span><span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
    <span class="cm">/**</span>
<span class="cm">    * @private</span>
<span class="cm">    * @property window</span>
<span class="cm">    * @description A reference to the currently open window object in any editor on the page.</span>
<span class="cm">    * @type Object &lt;a href=&quot;YAHOO.widget.EditorWindow.html&quot;&gt;YAHOO.widget.EditorWindow&lt;/a&gt;</span>
<span class="cm">    */</span>
    <span class="nb">window</span><span class="o">:</span> <span class="p">{},</span>
    <span class="cm">/**</span>
<span class="cm">    * @private</span>
<span class="cm">    * @property panel</span>
<span class="cm">    * @description A reference to the currently open panel in any editor on the page.</span>
<span class="cm">    * @type Object &lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;YAHOO.widget.Overlay&lt;/a&gt;</span>
<span class="cm">    */</span>
    <span class="nx">panel</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
    <span class="cm">/**</span>
<span class="cm">    * @method getEditorById</span>
<span class="cm">    * @description Returns a reference to the Editor object associated with the given textarea</span>
<span class="cm">    * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of</span>
<span class="cm">    * @return Object &lt;a href=&quot;YAHOO.widget.Editor.html&quot;&gt;YAHOO.widget.Editor&lt;/a&gt;</span>
<span class="cm">    */</span>
    <span class="nx">getEditorById</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">id</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">//Not a string, assume a node Reference</span>
            <span class="nx">id</span> <span class="o">=</span> <span class="nx">id</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_instances</span><span class="p">[</span><span class="nx">id</span><span class="p">])</span> <span class="p">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_instances</span><span class="p">[</span><span class="nx">id</span><span class="p">];</span>
        <span class="p">}</span>
        <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
    <span class="p">},</span>
    <span class="cm">/**</span>
<span class="cm">    * @method saveAll</span>
<span class="cm">    * @description Saves all Editor instances on the page. If a form reference is passed, only Editor&#39;s bound to this form will be saved.</span>
<span class="cm">    * @param {HTMLElement} form The form to check if this Editor instance belongs to</span>
<span class="cm">    */</span>
    <span class="nx">saveAll</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">form</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">e</span><span class="p">,</span> <span class="nx">items</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">EditorInfo</span><span class="p">.</span><span class="nx">_instances</span><span class="p">;</span>
        <span class="k">if</span> <span class="p">(</span><span class="nx">form</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">items</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">items</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">e</span> <span class="o">=</span> <span class="nx">items</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">form</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;element&#39;</span><span class="p">).</span><span class="nx">form</span> <span class="o">==</span> <span class="nx">form</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">e</span><span class="p">.</span><span class="nx">saveHTML</span><span class="p">();</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">items</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">items</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">items</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">saveHTML</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">},</span>
    <span class="cm">/**</span>
<span class="cm">    * @method toString</span>
<span class="cm">    * @description Returns a string representing the EditorInfo.</span>
<span class="cm">    * @return {String}</span>
<span class="cm">    */</span>
    <span class="nx">toString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
        <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="p">.</span><span class="nx">_instances</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_instances</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">len</span><span class="o">++</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">return</span> <span class="s1">&#39;Editor Info (&#39;</span> <span class="o">+</span> <span class="nx">len</span> <span class="o">+</span> <span class="s1">&#39; registered intance&#39;</span> <span class="o">+</span> <span class="p">((</span><span class="nx">len</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;s&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">};</span>



    
<span class="p">})();</span>
</pre></div>

                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_datemath.html" title="datemath">datemath</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class="selected"><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
                                <li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_storage.html" title="Storage">Storage</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.Editor.html" title="YAHOO.widget.Editor">YAHOO.widget.Editor</a></li>
                                <li class=""><a href="YAHOO.widget.EditorInfo.html" title="YAHOO.widget.EditorInfo">YAHOO.widget.EditorInfo</a></li>
                                <li class=""><a href="YAHOO.widget.EditorWindow.html" title="YAHOO.widget.EditorWindow">YAHOO.widget.EditorWindow</a></li>
                                <li class=""><a href="YAHOO.widget.SimpleEditor.html" title="YAHOO.widget.SimpleEditor">YAHOO.widget.SimpleEditor</a></li>
                                <li class=""><a href="YAHOO.widget.Toolbar.html" title="YAHOO.widget.Toolbar">YAHOO.widget.Toolbar</a></li>
                                <li class=""><a href="YAHOO.widget.ToolbarButton.html" title="YAHOO.widget.ToolbarButton">YAHOO.widget.ToolbarButton</a></li>
                                <li class=""><a href="YAHOO.widget.ToolbarButtonAdvanced.html" title="YAHOO.widget.ToolbarButtonAdvanced">YAHOO.widget.ToolbarButtonAdvanced</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="editor.js.html" title="editor.js">editor.js</a></li>
                                <li class="selected"><a href="simple-editor.js.html" title="simple-editor.js">simple-editor.js</a></li>
                                <li class=""><a href="toolbar-button.js.html" title="toolbar-button.js">toolbar-button.js</a></li>
                                <li class=""><a href="toolbar.js.html" title="toolbar.js">toolbar.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2011 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">

    var ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.widget.Toolbar", "name": "addButton", "url": "YAHOO.widget.Toolbar.html#method_addButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "addButtonGroup", "url": "YAHOO.widget.Toolbar.html#method_addButtonGroup", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "addButtonToGroup", "url": "YAHOO.widget.Toolbar.html#method_addButtonToGroup", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_addMenuClasses", "url": "YAHOO.widget.Toolbar.html#method__addMenuClasses", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "addSeparator", "url": "YAHOO.widget.Toolbar.html#method_addSeparator", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "afterElement", "url": "YAHOO.widget.SimpleEditor.html#property_afterElement", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "afterExecCommand", "url": "YAHOO.widget.SimpleEditor.html#event_afterExecCommand", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "afterNodeChange", "url": "YAHOO.widget.SimpleEditor.html#event_afterNodeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "afterOpenWindow", "url": "YAHOO.widget.Editor.html#event_afterOpenWindow", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "afterRender", "url": "YAHOO.widget.SimpleEditor.html#event_afterRender", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "allowNoEdit", "url": "YAHOO.widget.SimpleEditor.html#config_allowNoEdit", "type": "config"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_alwaysDisabled", "url": "YAHOO.widget.Editor.html#property__alwaysDisabled", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_alwaysDisabled", "url": "YAHOO.widget.SimpleEditor.html#property__alwaysDisabled", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_alwaysEnabled", "url": "YAHOO.widget.Editor.html#property__alwaysEnabled", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_alwaysEnabled", "url": "YAHOO.widget.SimpleEditor.html#property__alwaysEnabled", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "animate", "url": "YAHOO.widget.SimpleEditor.html#config_animate", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "animateChange", "url": "YAHOO.widget.SimpleEditor.html#event_animateChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.EditorWindow", "name": "attrs", "url": "YAHOO.widget.EditorWindow.html#property_attrs", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "autoHeight", "url": "YAHOO.widget.SimpleEditor.html#config_autoHeight", "type": "config"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_baseHREF", "url": "YAHOO.widget.SimpleEditor.html#property__baseHREF", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeAnimateChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeAnimateChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeBlankimageChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeBlankimageChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "beforeButtonsChange", "url": "YAHOO.widget.Toolbar.html#event_beforeButtonsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "beforeButtonTypeChange", "url": "YAHOO.widget.Toolbar.html#event_beforeButtonTypeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "beforeCollapseChange", "url": "YAHOO.widget.Toolbar.html#event_beforeCollapseChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeCssChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeCssChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeDisabledChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeDisabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "beforeDisabledChange", "url": "YAHOO.widget.ToolbarButton.html#event_beforeDisabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "beforeDisabledChange", "url": "YAHOO.widget.Toolbar.html#event_beforeDisabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeDompathChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeDompathChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "beforeDraggableChange", "url": "YAHOO.widget.Toolbar.html#event_beforeDraggableChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeEditorClick", "url": "YAHOO.widget.SimpleEditor.html#event_beforeEditorClick", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeEditorDoubleClick", "url": "YAHOO.widget.SimpleEditor.html#event_beforeEditorDoubleClick", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeEditorKeyDown", "url": "YAHOO.widget.SimpleEditor.html#event_beforeEditorKeyDown", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeEditorKeyPress", "url": "YAHOO.widget.SimpleEditor.html#event_beforeEditorKeyPress", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeEditorKeyUp", "url": "YAHOO.widget.SimpleEditor.html#event_beforeEditorKeyUp", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeEditorMouseDown", "url": "YAHOO.widget.SimpleEditor.html#event_beforeEditorMouseDown", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeEditorMouseUp", "url": "YAHOO.widget.SimpleEditor.html#event_beforeEditorMouseUp", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeElement", "url": "YAHOO.widget.SimpleEditor.html#property_beforeElement", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeExecCommand", "url": "YAHOO.widget.SimpleEditor.html#event_beforeExecCommand", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeExtracssChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeExtracssChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeFocusAtStartChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeFocusAtStartChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "beforeGrouplabelsChange", "url": "YAHOO.widget.Toolbar.html#event_beforeGrouplabelsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeHandleSubmitChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeHandleSubmitChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeHeightChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeHeightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "beforeHiddencssChange", "url": "YAHOO.widget.Editor.html#event_beforeHiddencssChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeHtmlChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeHtmlChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "beforeLabelChange", "url": "YAHOO.widget.ToolbarButton.html#event_beforeLabelChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "beforeLocalFileWarningChange", "url": "YAHOO.widget.Editor.html#event_beforeLocalFileWarningChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeMarkupChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeMarkupChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "beforeMenuChange", "url": "YAHOO.widget.ToolbarButton.html#event_beforeMenuChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeNodeChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeNodeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "beforeOpenWindow", "url": "YAHOO.widget.Editor.html#event_beforeOpenWindow", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeRemoveLineBreaksChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeRemoveLineBreaksChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "beforeTitlebarChange", "url": "YAHOO.widget.Toolbar.html#event_beforeTitlebarChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "beforeTitleChange", "url": "YAHOO.widget.ToolbarButton.html#event_beforeTitleChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeToolbarChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeToolbarChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "beforeTypeChange", "url": "YAHOO.widget.ToolbarButton.html#event_beforeTypeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "beforeValueChange", "url": "YAHOO.widget.ToolbarButton.html#event_beforeValueChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "beforeWidthChange", "url": "YAHOO.widget.SimpleEditor.html#event_beforeWidthChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "blankimage", "url": "YAHOO.widget.SimpleEditor.html#config_blankimage", "type": "config"}, {"access": "private", "host": "YAHOO.widget.EditorInfo", "name": "blankImage", "url": "YAHOO.widget.EditorInfo.html#property_blankImage", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "blankimageChange", "url": "YAHOO.widget.SimpleEditor.html#event_blankimageChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_blankImageLoaded", "url": "YAHOO.widget.SimpleEditor.html#property__blankImageLoaded", "type": "property"}, {"access": "private", "host": "YAHOO.widget.EditorWindow", "name": "body", "url": "YAHOO.widget.EditorWindow.html#property_body", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "browser", "url": "YAHOO.widget.SimpleEditor.html#property_browser", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "browser", "url": "YAHOO.widget.Toolbar.html#property_browser", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "_buttonClick", "url": "YAHOO.widget.Toolbar.html#method__buttonClick", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "buttonClick", "url": "YAHOO.widget.Toolbar.html#event_buttonClick", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "_buttonGroupList", "url": "YAHOO.widget.Toolbar.html#property__buttonGroupList", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "_buttonList", "url": "YAHOO.widget.Toolbar.html#property__buttonList", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "buttons", "url": "YAHOO.widget.Toolbar.html#config_buttons", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "buttonsChange", "url": "YAHOO.widget.Toolbar.html#event_buttonsChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ToolbarButtonAdvanced", "name": "buttonType", "url": "YAHOO.widget.ToolbarButtonAdvanced.html#property_buttonType", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ToolbarButton", "name": "buttonType", "url": "YAHOO.widget.ToolbarButton.html#property_buttonType", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "buttonType", "url": "YAHOO.widget.Toolbar.html#property_buttonType", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "buttonType", "url": "YAHOO.widget.Toolbar.html#config_buttonType", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "buttonTypeChange", "url": "YAHOO.widget.Toolbar.html#event_buttonTypeChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_checkKey", "url": "YAHOO.widget.SimpleEditor.html#method__checkKey", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_checkLoaded", "url": "YAHOO.widget.SimpleEditor.html#method__checkLoaded", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_checkUndo", "url": "YAHOO.widget.Editor.html#method__checkUndo", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButtonAdvanced", "name": "checkValue", "url": "YAHOO.widget.ToolbarButtonAdvanced.html#method_checkValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "checkValue", "url": "YAHOO.widget.ToolbarButton.html#method_checkValue", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.SimpleEditor", "name": "CLASS_CONTAINER", "url": "YAHOO.widget.SimpleEditor.html#property_CLASS_CONTAINER", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "CLASS_CONTAINER", "url": "YAHOO.widget.Toolbar.html#property_CLASS_CONTAINER", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "CLASS_DISABLED", "url": "YAHOO.widget.Toolbar.html#property_CLASS_DISABLED", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "CLASS_DRAGHANDLE", "url": "YAHOO.widget.Toolbar.html#property_CLASS_DRAGHANDLE", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.SimpleEditor", "name": "CLASS_EDITABLE", "url": "YAHOO.widget.SimpleEditor.html#property_CLASS_EDITABLE", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.SimpleEditor", "name": "CLASS_EDITABLE_CONT", "url": "YAHOO.widget.SimpleEditor.html#property_CLASS_EDITABLE_CONT", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Editor", "name": "CLASS_HIDDEN", "url": "YAHOO.widget.Editor.html#property_CLASS_HIDDEN", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Editor", "name": "CLASS_LOCAL_FILE", "url": "YAHOO.widget.Editor.html#property_CLASS_LOCAL_FILE", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.SimpleEditor", "name": "CLASS_NOEDIT", "url": "YAHOO.widget.SimpleEditor.html#property_CLASS_NOEDIT", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.SimpleEditor", "name": "CLASS_PREFIX", "url": "YAHOO.widget.SimpleEditor.html#property_CLASS_PREFIX", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "CLASS_PREFIX", "url": "YAHOO.widget.Toolbar.html#property_CLASS_PREFIX", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "CLASS_SEPARATOR", "url": "YAHOO.widget.Toolbar.html#property_CLASS_SEPARATOR", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_cleanClassName", "url": "YAHOO.widget.SimpleEditor.html#method__cleanClassName", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cleanHTML", "url": "YAHOO.widget.SimpleEditor.html#method_cleanHTML", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cleanHTML", "url": "YAHOO.widget.SimpleEditor.html#event_cleanHTML", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "_cleanIncomingHTML", "url": "YAHOO.widget.SimpleEditor.html#method__cleanIncomingHTML", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "clearEditorDoc", "url": "YAHOO.widget.SimpleEditor.html#method_clearEditorDoc", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_closeWindow", "url": "YAHOO.widget.Editor.html#method__closeWindow", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "closeWindow", "url": "YAHOO.widget.Editor.html#method_closeWindow", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "closeWindow", "url": "YAHOO.widget.Editor.html#event_closeWindow", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_closeWindow", "url": "YAHOO.widget.SimpleEditor.html#method__closeWindow", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "closeWindow", "url": "YAHOO.widget.SimpleEditor.html#method_closeWindow", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_backcolor", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_backcolor", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_bold", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_bold", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_createlink", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_createlink", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_fontname", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_fontname", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_fontsize", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_fontsize", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_forecolor", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_forecolor", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_heading", "url": "YAHOO.widget.Editor.html#method_cmd_heading", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_hiddenelements", "url": "YAHOO.widget.Editor.html#method_cmd_hiddenelements", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_indent", "url": "YAHOO.widget.Editor.html#method_cmd_indent", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_inserthtml", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_inserthtml", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_insertimage", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_insertimage", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_insertorderedlist", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_insertorderedlist", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_insertunorderedlist", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_insertunorderedlist", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_italic", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_italic", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_justify", "url": "YAHOO.widget.Editor.html#method_cmd_justify", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_justifycenter", "url": "YAHOO.widget.Editor.html#method_cmd_justifycenter", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_justifyleft", "url": "YAHOO.widget.Editor.html#method_cmd_justifyleft", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_justifyright", "url": "YAHOO.widget.Editor.html#method_cmd_justifyright", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_list", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_list", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_outdent", "url": "YAHOO.widget.Editor.html#method_cmd_outdent", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_redo", "url": "YAHOO.widget.Editor.html#method_cmd_redo", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_removeformat", "url": "YAHOO.widget.Editor.html#method_cmd_removeformat", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_script", "url": "YAHOO.widget.Editor.html#method_cmd_script", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_subscript", "url": "YAHOO.widget.Editor.html#method_cmd_subscript", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_superscript", "url": "YAHOO.widget.Editor.html#method_cmd_superscript", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_underline", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_underline", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "cmd_undo", "url": "YAHOO.widget.Editor.html#method_cmd_undo", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cmd_unlink", "url": "YAHOO.widget.SimpleEditor.html#method_cmd_unlink", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "collapse", "url": "YAHOO.widget.Toolbar.html#method_collapse", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "collapse", "url": "YAHOO.widget.Toolbar.html#config_collapse", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "collapseChange", "url": "YAHOO.widget.Toolbar.html#event_collapseChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "_colorData", "url": "YAHOO.widget.Toolbar.html#property__colorData", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "_colorPicker", "url": "YAHOO.widget.Toolbar.html#property__colorPicker", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "_configuredButtons", "url": "YAHOO.widget.Toolbar.html#property__configuredButtons", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "cont", "url": "YAHOO.widget.Toolbar.html#config_cont", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "container", "url": "YAHOO.widget.SimpleEditor.html#config_container", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "container", "url": "YAHOO.widget.ToolbarButton.html#config_container", "type": "config"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_contentTimer", "url": "YAHOO.widget.SimpleEditor.html#property__contentTimer", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_contentTimerCounter", "url": "YAHOO.widget.SimpleEditor.html#property__contentTimerCounter", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_contentTimerMax", "url": "YAHOO.widget.SimpleEditor.html#property__contentTimerMax", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_createColorPicker", "url": "YAHOO.widget.Toolbar.html#method__createColorPicker", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_createCurrentElement", "url": "YAHOO.widget.SimpleEditor.html#method__createCurrentElement", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_createIframe", "url": "YAHOO.widget.SimpleEditor.html#method__createIframe", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_createInsertElement", "url": "YAHOO.widget.SimpleEditor.html#method__createInsertElement", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "css", "url": "YAHOO.widget.SimpleEditor.html#config_css", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "cssChange", "url": "YAHOO.widget.SimpleEditor.html#event_cssChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "currentElement", "url": "YAHOO.widget.SimpleEditor.html#property_currentElement", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "currentEvent", "url": "YAHOO.widget.SimpleEditor.html#property_currentEvent", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "currentFont", "url": "YAHOO.widget.SimpleEditor.html#property_currentFont", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "currentWindow", "url": "YAHOO.widget.SimpleEditor.html#property_currentWindow", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "dd", "url": "YAHOO.widget.SimpleEditor.html#property_dd", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "dd", "url": "YAHOO.widget.Toolbar.html#property_dd", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "_defaultCSS", "url": "YAHOO.widget.SimpleEditor.html#property__defaultCSS", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_defaultImageToolbar", "url": "YAHOO.widget.Editor.html#method__defaultImageToolbar", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_defaultImageToolbarConfig", "url": "YAHOO.widget.Editor.html#method__defaultImageToolbarConfig", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_defaultToolbar", "url": "YAHOO.widget.SimpleEditor.html#property__defaultToolbar", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "deselectAllButtons", "url": "YAHOO.widget.Toolbar.html#method_deselectAllButtons", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "deselectButton", "url": "YAHOO.widget.Toolbar.html#method_deselectButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "destroy", "url": "YAHOO.widget.SimpleEditor.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "destroy", "url": "YAHOO.widget.ToolbarButton.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "destroy", "url": "YAHOO.widget.Toolbar.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "destroyButton", "url": "YAHOO.widget.Toolbar.html#method_destroyButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "disableAllButtons", "url": "YAHOO.widget.Toolbar.html#method_disableAllButtons", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "disableButton", "url": "YAHOO.widget.Toolbar.html#method_disableButton", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_disabled", "url": "YAHOO.widget.Editor.html#property__disabled", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_disabled", "url": "YAHOO.widget.SimpleEditor.html#property__disabled", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "disabled", "url": "YAHOO.widget.SimpleEditor.html#config_disabled", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "disabled", "url": "YAHOO.widget.ToolbarButton.html#config_disabled", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "disabled", "url": "YAHOO.widget.Toolbar.html#config_disabled", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "disabledChange", "url": "YAHOO.widget.SimpleEditor.html#event_disabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "disabledChange", "url": "YAHOO.widget.ToolbarButton.html#event_disabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "disabledChange", "url": "YAHOO.widget.Toolbar.html#event_disabledChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "disabled_iframe", "url": "YAHOO.widget.SimpleEditor.html#config_disabled_iframe", "type": "config"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_disableEditor", "url": "YAHOO.widget.SimpleEditor.html#method__disableEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "_docType", "url": "YAHOO.widget.SimpleEditor.html#property__docType", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "dompath", "url": "YAHOO.widget.SimpleEditor.html#property_dompath", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "dompath", "url": "YAHOO.widget.SimpleEditor.html#config_dompath", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "dompathChange", "url": "YAHOO.widget.SimpleEditor.html#event_dompathChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "DOMReady", "url": "YAHOO.widget.SimpleEditor.html#property_DOMReady", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "drag", "url": "YAHOO.widget.SimpleEditor.html#config_drag", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "draggable", "url": "YAHOO.widget.Toolbar.html#config_draggable", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "draggableChange", "url": "YAHOO.widget.Toolbar.html#event_draggableChange", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "draghandle", "url": "YAHOO.widget.Toolbar.html#property_draghandle", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorClick", "url": "YAHOO.widget.SimpleEditor.html#event_editorClick", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorContentLoaded", "url": "YAHOO.widget.SimpleEditor.html#event_editorContentLoaded", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorDirty", "url": "YAHOO.widget.SimpleEditor.html#property_editorDirty", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorDoubleClick", "url": "YAHOO.widget.SimpleEditor.html#event_editorDoubleClick", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorKeyDown", "url": "YAHOO.widget.SimpleEditor.html#event_editorKeyDown", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorKeyPress", "url": "YAHOO.widget.SimpleEditor.html#event_editorKeyPress", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorKeyUp", "url": "YAHOO.widget.SimpleEditor.html#event_editorKeyUp", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorMouseDown", "url": "YAHOO.widget.SimpleEditor.html#event_editorMouseDown", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorMouseUp", "url": "YAHOO.widget.SimpleEditor.html#event_editorMouseUp", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "EDITOR_PANEL_ID", "url": "YAHOO.widget.Editor.html#property_EDITOR_PANEL_ID", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorWindowBlur", "url": "YAHOO.widget.SimpleEditor.html#event_editorWindowBlur", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "editorWindowFocus", "url": "YAHOO.widget.SimpleEditor.html#event_editorWindowFocus", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "editor_wrapper", "url": "YAHOO.widget.SimpleEditor.html#config_editor_wrapper", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "element_cont", "url": "YAHOO.widget.SimpleEditor.html#config_element_cont", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "enableAllButtons", "url": "YAHOO.widget.Toolbar.html#method_enableAllButtons", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "enableButton", "url": "YAHOO.widget.Toolbar.html#method_enableButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "execCommand", "url": "YAHOO.widget.SimpleEditor.html#method_execCommand", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "extracss", "url": "YAHOO.widget.SimpleEditor.html#config_extracss", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "extracssChange", "url": "YAHOO.widget.SimpleEditor.html#event_extracssChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "filter_all_rgb", "url": "YAHOO.widget.SimpleEditor.html#method_filter_all_rgb", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "filter_internals", "url": "YAHOO.widget.SimpleEditor.html#method_filter_internals", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "filter_invalid_lists", "url": "YAHOO.widget.SimpleEditor.html#method_filter_invalid_lists", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "filter_msword", "url": "YAHOO.widget.SimpleEditor.html#method_filter_msword", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "filter_rgb", "url": "YAHOO.widget.SimpleEditor.html#method_filter_rgb", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "filter_safari", "url": "YAHOO.widget.SimpleEditor.html#method_filter_safari", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "filterWord", "url": "YAHOO.widget.SimpleEditor.html#config_filterWord", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "fireEvent", "url": "YAHOO.widget.ToolbarButton.html#method_fireEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_fixListDupIds", "url": "YAHOO.widget.SimpleEditor.html#method__fixListDupIds", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_fixListRunning", "url": "YAHOO.widget.SimpleEditor.html#property__fixListRunning", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_fixNodes", "url": "YAHOO.widget.Editor.html#method__fixNodes", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_fixNodes", "url": "YAHOO.widget.SimpleEditor.html#method__fixNodes", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_fixNodesTimer", "url": "YAHOO.widget.SimpleEditor.html#property__fixNodesTimer", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "focus", "url": "YAHOO.widget.SimpleEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "focusAtStart", "url": "YAHOO.widget.SimpleEditor.html#config_focusAtStart", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "focusAtStartChange", "url": "YAHOO.widget.SimpleEditor.html#event_focusAtStartChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_focused", "url": "YAHOO.widget.SimpleEditor.html#property__focused", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_focusWindow", "url": "YAHOO.widget.SimpleEditor.html#method__focusWindow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.EditorWindow", "name": "footer", "url": "YAHOO.widget.EditorWindow.html#property_footer", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_formButtonClicked", "url": "YAHOO.widget.SimpleEditor.html#property__formButtonClicked", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_formButtons", "url": "YAHOO.widget.SimpleEditor.html#property__formButtons", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_getBlankImage", "url": "YAHOO.widget.SimpleEditor.html#method__getBlankImage", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "getButtonById", "url": "YAHOO.widget.Toolbar.html#method_getButtonById", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "getButtonByIndex", "url": "YAHOO.widget.Toolbar.html#method_getButtonByIndex", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "getButtonByValue", "url": "YAHOO.widget.Toolbar.html#method_getButtonByValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "getButtons", "url": "YAHOO.widget.Toolbar.html#method_getButtons", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_getDoc", "url": "YAHOO.widget.SimpleEditor.html#method__getDoc", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_getDomPath", "url": "YAHOO.widget.SimpleEditor.html#method__getDomPath", "type": "method"}, {"access": "", "host": "YAHOO.widget.EditorInfo", "name": "getEditorById", "url": "YAHOO.widget.EditorInfo.html#method_getEditorById", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "getEditorHTML", "url": "YAHOO.widget.SimpleEditor.html#method_getEditorHTML", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "getMenu", "url": "YAHOO.widget.ToolbarButton.html#method_getMenu", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_getRange", "url": "YAHOO.widget.SimpleEditor.html#method__getRange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_getSelectedElement", "url": "YAHOO.widget.SimpleEditor.html#method__getSelectedElement", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_getSelection", "url": "YAHOO.widget.SimpleEditor.html#method__getSelection", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_getUndo", "url": "YAHOO.widget.Editor.html#method__getUndo", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_getWindow", "url": "YAHOO.widget.SimpleEditor.html#method__getWindow", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "grouplabels", "url": "YAHOO.widget.Toolbar.html#config_grouplabels", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "grouplabelsChange", "url": "YAHOO.widget.Toolbar.html#event_grouplabelsChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleAfterNodeChange", "url": "YAHOO.widget.SimpleEditor.html#method__handleAfterNodeChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleAlign", "url": "YAHOO.widget.SimpleEditor.html#method__handleAlign", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleAutoHeight", "url": "YAHOO.widget.SimpleEditor.html#method__handleAutoHeight", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleBlur", "url": "YAHOO.widget.SimpleEditor.html#method__handleBlur", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleClick", "url": "YAHOO.widget.SimpleEditor.html#method__handleClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleColorPicker", "url": "YAHOO.widget.SimpleEditor.html#method__handleColorPicker", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleCreateLinkClick", "url": "YAHOO.widget.SimpleEditor.html#method__handleCreateLinkClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_handleCreateLinkWindowClose", "url": "YAHOO.widget.Editor.html#method__handleCreateLinkWindowClose", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleCreateLinkWindowClose", "url": "YAHOO.widget.SimpleEditor.html#method__handleCreateLinkWindowClose", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleDoubleClick", "url": "YAHOO.widget.SimpleEditor.html#method__handleDoubleClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleFocus", "url": "YAHOO.widget.SimpleEditor.html#method__handleFocus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_handleFocus", "url": "YAHOO.widget.Toolbar.html#method__handleFocus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleFontSize", "url": "YAHOO.widget.SimpleEditor.html#method__handleFontSize", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleFormButtonClick", "url": "YAHOO.widget.SimpleEditor.html#method__handleFormButtonClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleFormSubmit", "url": "YAHOO.widget.SimpleEditor.html#method__handleFormSubmit", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_handleInsertImageClick", "url": "YAHOO.widget.Editor.html#method__handleInsertImageClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleInsertImageClick", "url": "YAHOO.widget.SimpleEditor.html#method__handleInsertImageClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_handleInsertImageWindowClose", "url": "YAHOO.widget.Editor.html#method__handleInsertImageWindowClose", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleInsertImageWindowClose", "url": "YAHOO.widget.SimpleEditor.html#method__handleInsertImageWindowClose", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_handleKeyDown", "url": "YAHOO.widget.Editor.html#method__handleKeyDown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleKeyDown", "url": "YAHOO.widget.SimpleEditor.html#method__handleKeyDown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleKeyPress", "url": "YAHOO.widget.SimpleEditor.html#method__handleKeyPress", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleKeyUp", "url": "YAHOO.widget.SimpleEditor.html#method__handleKeyUp", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleMouseDown", "url": "YAHOO.widget.SimpleEditor.html#method__handleMouseDown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ToolbarButton", "name": "_handleMouseOut", "url": "YAHOO.widget.ToolbarButton.html#method__handleMouseOut", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ToolbarButton", "name": "_handleMouseOver", "url": "YAHOO.widget.ToolbarButton.html#method__handleMouseOver", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleMouseUp", "url": "YAHOO.widget.SimpleEditor.html#method__handleMouseUp", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ToolbarButton", "name": "_handleSelect", "url": "YAHOO.widget.ToolbarButton.html#method__handleSelect", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "handleSubmit", "url": "YAHOO.widget.SimpleEditor.html#config_handleSubmit", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "handleSubmitChange", "url": "YAHOO.widget.SimpleEditor.html#event_handleSubmitChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_handleToolbarClick", "url": "YAHOO.widget.SimpleEditor.html#method__handleToolbarClick", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "_handleWindowInputs", "url": "YAHOO.widget.Editor.html#method__handleWindowInputs", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_hasParent", "url": "YAHOO.widget.SimpleEditor.html#method__hasParent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_hasSelection", "url": "YAHOO.widget.SimpleEditor.html#method__hasSelection", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_hasUndoLevel", "url": "YAHOO.widget.Editor.html#method__hasUndoLevel", "type": "method"}, {"access": "private", "host": "YAHOO.widget.EditorWindow", "name": "header", "url": "YAHOO.widget.EditorWindow.html#property_header", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "height", "url": "YAHOO.widget.SimpleEditor.html#config_height", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "heightChange", "url": "YAHOO.widget.SimpleEditor.html#event_heightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "hiddencss", "url": "YAHOO.widget.Editor.html#config_hiddencss", "type": "config"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "hiddencssChange", "url": "YAHOO.widget.Editor.html#event_hiddencssChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "hide", "url": "YAHOO.widget.SimpleEditor.html#method_hide", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "html", "url": "YAHOO.widget.SimpleEditor.html#config_html", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "htmlChange", "url": "YAHOO.widget.SimpleEditor.html#event_htmlChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "iframe", "url": "YAHOO.widget.SimpleEditor.html#config_iframe", "type": "config"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "init", "url": "YAHOO.widget.Editor.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "init", "url": "YAHOO.widget.SimpleEditor.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "init", "url": "YAHOO.widget.ToolbarButton.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "init", "url": "YAHOO.widget.Toolbar.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "initAttributes", "url": "YAHOO.widget.Editor.html#method_initAttributes", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "initAttributes", "url": "YAHOO.widget.SimpleEditor.html#method_initAttributes", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "initAttributes", "url": "YAHOO.widget.ToolbarButton.html#method_initAttributes", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "initAttributes", "url": "YAHOO.widget.Toolbar.html#method_initAttributes", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_initEditor", "url": "YAHOO.widget.SimpleEditor.html#method__initEditor", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_initEditorEvents", "url": "YAHOO.widget.SimpleEditor.html#method__initEditorEvents", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "insert", "url": "YAHOO.widget.SimpleEditor.html#config_insert", "type": "config"}, {"access": "private", "host": "YAHOO.widget.EditorInfo", "name": "_instances", "url": "YAHOO.widget.EditorInfo.html#property__instances", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "invalidHTML", "url": "YAHOO.widget.SimpleEditor.html#property_invalidHTML", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_isElement", "url": "YAHOO.widget.SimpleEditor.html#method__isElement", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_isLocalFile", "url": "YAHOO.widget.SimpleEditor.html#method__isLocalFile", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_isNonEditable", "url": "YAHOO.widget.SimpleEditor.html#method__isNonEditable", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "isSelected", "url": "YAHOO.widget.Toolbar.html#method_isSelected", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_keyMap", "url": "YAHOO.widget.SimpleEditor.html#property__keyMap", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_keyNav", "url": "YAHOO.widget.Toolbar.html#property__keyNav", "type": "property"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "label", "url": "YAHOO.widget.ToolbarButton.html#config_label", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "labelChange", "url": "YAHOO.widget.ToolbarButton.html#event_labelChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_lastButton", "url": "YAHOO.widget.SimpleEditor.html#property__lastButton", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_lastCommand", "url": "YAHOO.widget.SimpleEditor.html#property__lastCommand", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_lastImage", "url": "YAHOO.widget.SimpleEditor.html#property__lastImage", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_lastNodeChange", "url": "YAHOO.widget.SimpleEditor.html#property__lastNodeChange", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_lastNodeChangeEvent", "url": "YAHOO.widget.SimpleEditor.html#property__lastNodeChangeEvent", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "limitCommands", "url": "YAHOO.widget.SimpleEditor.html#config_limitCommands", "type": "config"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_listFix", "url": "YAHOO.widget.SimpleEditor.html#method__listFix", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "localFileWarning", "url": "YAHOO.widget.Editor.html#config_localFileWarning", "type": "config"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "localFileWarningChange", "url": "YAHOO.widget.Editor.html#event_localFileWarningChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_makeColorButton", "url": "YAHOO.widget.Toolbar.html#method__makeColorButton", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_makeSpinButton", "url": "YAHOO.widget.Toolbar.html#method__makeSpinButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "markup", "url": "YAHOO.widget.SimpleEditor.html#config_markup", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "markupChange", "url": "YAHOO.widget.SimpleEditor.html#event_markupChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_mask", "url": "YAHOO.widget.SimpleEditor.html#property__mask", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "maxUndo", "url": "YAHOO.widget.SimpleEditor.html#config_maxUndo", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "menu", "url": "YAHOO.widget.ToolbarButton.html#config_menu", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "menuChange", "url": "YAHOO.widget.ToolbarButton.html#event_menuChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "moveWindow", "url": "YAHOO.widget.Editor.html#method_moveWindow", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "moveWindow", "url": "YAHOO.widget.SimpleEditor.html#method_moveWindow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.EditorWindow", "name": "name", "url": "YAHOO.widget.EditorWindow.html#property_name", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_navCounter", "url": "YAHOO.widget.Toolbar.html#property__navCounter", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_navigateButtons", "url": "YAHOO.widget.Toolbar.html#method__navigateButtons", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_nodeChange", "url": "YAHOO.widget.SimpleEditor.html#method__nodeChange", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "nodeChange", "url": "YAHOO.widget.SimpleEditor.html#method_nodeChange", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "nodeChangeDelay", "url": "YAHOO.widget.SimpleEditor.html#config_nodeChangeDelay", "type": "config"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_nodeChangeDelayTimer", "url": "YAHOO.widget.SimpleEditor.html#property__nodeChangeDelayTimer", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "nodeChangeThreshold", "url": "YAHOO.widget.SimpleEditor.html#config_nodeChangeThreshold", "type": "config"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_nodeChangeTimer", "url": "YAHOO.widget.SimpleEditor.html#property__nodeChangeTimer", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "openWindow", "url": "YAHOO.widget.Editor.html#method_openWindow", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "openWindow", "url": "YAHOO.widget.SimpleEditor.html#method_openWindow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "operaEvent", "url": "YAHOO.widget.SimpleEditor.html#property_operaEvent", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "panel", "url": "YAHOO.widget.SimpleEditor.html#config_panel", "type": "config"}, {"access": "private", "host": "YAHOO.widget.EditorInfo", "name": "panel", "url": "YAHOO.widget.EditorInfo.html#property_panel", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "plainText", "url": "YAHOO.widget.SimpleEditor.html#config_plainText", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "post_filter_linebreaks", "url": "YAHOO.widget.SimpleEditor.html#method_post_filter_linebreaks", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "pre_filter_linebreaks", "url": "YAHOO.widget.SimpleEditor.html#method_pre_filter_linebreaks", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "ptags", "url": "YAHOO.widget.SimpleEditor.html#config_ptags", "type": "config"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_putUndo", "url": "YAHOO.widget.Editor.html#method__putUndo", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_removeEditorEvents", "url": "YAHOO.widget.SimpleEditor.html#method__removeEditorEvents", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "removeLineBreaks", "url": "YAHOO.widget.SimpleEditor.html#config_removeLineBreaks", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "removeLineBreaksChange", "url": "YAHOO.widget.SimpleEditor.html#event_removeLineBreaksChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_render", "url": "YAHOO.widget.SimpleEditor.html#method__render", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "render", "url": "YAHOO.widget.SimpleEditor.html#method_render", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_renderCreateLinkWindow", "url": "YAHOO.widget.Editor.html#method__renderCreateLinkWindow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_rendered", "url": "YAHOO.widget.SimpleEditor.html#property__rendered", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_renderInsertImageWindow", "url": "YAHOO.widget.Editor.html#method__renderInsertImageWindow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_renderPanel", "url": "YAHOO.widget.Editor.html#method__renderPanel", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "resetAllButtons", "url": "YAHOO.widget.Toolbar.html#method_resetAllButtons", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Toolbar", "name": "_resetColorPicker", "url": "YAHOO.widget.Toolbar.html#method__resetColorPicker", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "resize", "url": "YAHOO.widget.SimpleEditor.html#property_resize", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "resize", "url": "YAHOO.widget.SimpleEditor.html#config_resize", "type": "config"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_resizeConfig", "url": "YAHOO.widget.SimpleEditor.html#property__resizeConfig", "type": "property"}, {"access": "", "host": "YAHOO.widget.EditorInfo", "name": "saveAll", "url": "YAHOO.widget.EditorInfo.html#method_saveAll", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "saveEl", "url": "YAHOO.widget.SimpleEditor.html#config_saveEl", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "saveHTML", "url": "YAHOO.widget.SimpleEditor.html#method_saveHTML", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "selectButton", "url": "YAHOO.widget.Toolbar.html#method_selectButton", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_selection", "url": "YAHOO.widget.SimpleEditor.html#property__selection", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_selectNode", "url": "YAHOO.widget.SimpleEditor.html#method__selectNode", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_semantic", "url": "YAHOO.widget.SimpleEditor.html#property__semantic", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "_sep", "url": "YAHOO.widget.Toolbar.html#property__sep", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "_sepCount", "url": "YAHOO.widget.Toolbar.html#property__sepCount", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "SEP_DOMPATH", "url": "YAHOO.widget.SimpleEditor.html#property_SEP_DOMPATH", "type": "property"}, {"access": "", "host": "YAHOO.widget.EditorWindow", "name": "setBody", "url": "YAHOO.widget.EditorWindow.html#method_setBody", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_setCurrentEvent", "url": "YAHOO.widget.SimpleEditor.html#method__setCurrentEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_setDesignMode", "url": "YAHOO.widget.SimpleEditor.html#method__setDesignMode", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "setDesignMode", "url": "YAHOO.widget.SimpleEditor.html#config_setDesignMode", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "setEditorHTML", "url": "YAHOO.widget.SimpleEditor.html#method_setEditorHTML", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "_setEditorStyle", "url": "YAHOO.widget.SimpleEditor.html#method__setEditorStyle", "type": "method"}, {"access": "", "host": "YAHOO.widget.EditorWindow", "name": "setFooter", "url": "YAHOO.widget.EditorWindow.html#method_setFooter", "type": "method"}, {"access": "", "host": "YAHOO.widget.EditorWindow", "name": "setHeader", "url": "YAHOO.widget.EditorWindow.html#method_setHeader", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_setInitialContent", "url": "YAHOO.widget.SimpleEditor.html#method__setInitialContent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_setMarkupType", "url": "YAHOO.widget.SimpleEditor.html#method__setMarkupType", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_setupAfterElement", "url": "YAHOO.widget.SimpleEditor.html#method__setupAfterElement", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_setupDD", "url": "YAHOO.widget.SimpleEditor.html#method__setupDD", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_setupResize", "url": "YAHOO.widget.SimpleEditor.html#method__setupResize", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "show", "url": "YAHOO.widget.SimpleEditor.html#method_show", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_showingHiddenElements", "url": "YAHOO.widget.SimpleEditor.html#property__showingHiddenElements", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.SimpleEditor", "name": "STOP_EXEC_COMMAND", "url": "YAHOO.widget.SimpleEditor.html#property_STOP_EXEC_COMMAND", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.SimpleEditor", "name": "STOP_NODE_CHANGE", "url": "YAHOO.widget.SimpleEditor.html#property_STOP_NODE_CHANGE", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_storeUndo", "url": "YAHOO.widget.Editor.html#method__storeUndo", "type": "method"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_BEFORE_EDITOR", "url": "YAHOO.widget.Editor.html#property_STR_BEFORE_EDITOR", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "STR_BEFORE_EDITOR", "url": "YAHOO.widget.SimpleEditor.html#property_STR_BEFORE_EDITOR", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_CLOSE_WINDOW", "url": "YAHOO.widget.Editor.html#property_STR_CLOSE_WINDOW", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_CLOSE_WINDOW_NOTE", "url": "YAHOO.widget.Editor.html#property_STR_CLOSE_WINDOW_NOTE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "STR_COLLAPSE", "url": "YAHOO.widget.Toolbar.html#property_STR_COLLAPSE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "STR_EXPAND", "url": "YAHOO.widget.Toolbar.html#property_STR_EXPAND", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_BORDER", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_BORDER", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_BORDER_SIZE", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_BORDER_SIZE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_BORDER_TYPE", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_BORDER_TYPE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_COPY", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_COPY", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "STR_IMAGE_HERE", "url": "YAHOO.widget.SimpleEditor.html#property_STR_IMAGE_HERE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_ORIG_SIZE", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_ORIG_SIZE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_PADDING", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_PADDING", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_PROP_TITLE", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_PROP_TITLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_SIZE", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_SIZE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_TEXTFLOW", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_TEXTFLOW", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_IMAGE_TITLE", "url": "YAHOO.widget.Editor.html#property_STR_IMAGE_TITLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "STR_IMAGE_URL", "url": "YAHOO.widget.SimpleEditor.html#property_STR_IMAGE_URL", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "STR_LEAVE_EDITOR", "url": "YAHOO.widget.SimpleEditor.html#property_STR_LEAVE_EDITOR", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_LINK_NEW_WINDOW", "url": "YAHOO.widget.Editor.html#property_STR_LINK_NEW_WINDOW", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_LINK_PROP_REMOVE", "url": "YAHOO.widget.Editor.html#property_STR_LINK_PROP_REMOVE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_LINK_PROP_TITLE", "url": "YAHOO.widget.Editor.html#property_STR_LINK_PROP_TITLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_LINK_TITLE", "url": "YAHOO.widget.Editor.html#property_STR_LINK_TITLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "STR_LINK_URL", "url": "YAHOO.widget.SimpleEditor.html#property_STR_LINK_URL", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_LOCAL_FILE_WARNING", "url": "YAHOO.widget.Editor.html#property_STR_LOCAL_FILE_WARNING", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "STR_NONE", "url": "YAHOO.widget.Editor.html#property_STR_NONE", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "STR_SPIN_DOWN", "url": "YAHOO.widget.Toolbar.html#property_STR_SPIN_DOWN", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "STR_SPIN_LABEL", "url": "YAHOO.widget.Toolbar.html#property_STR_SPIN_LABEL", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "STR_SPIN_UP", "url": "YAHOO.widget.Toolbar.html#property_STR_SPIN_UP", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "STR_TITLE", "url": "YAHOO.widget.SimpleEditor.html#property_STR_TITLE", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_swapEl", "url": "YAHOO.widget.SimpleEditor.html#method__swapEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_tag2cmd", "url": "YAHOO.widget.SimpleEditor.html#property__tag2cmd", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "_textarea", "url": "YAHOO.widget.SimpleEditor.html#property__textarea", "type": "property"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "textarea", "url": "YAHOO.widget.SimpleEditor.html#config_textarea", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "title", "url": "YAHOO.widget.ToolbarButton.html#config_title", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "_titlebar", "url": "YAHOO.widget.Toolbar.html#property__titlebar", "type": "property"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "titlebar", "url": "YAHOO.widget.Toolbar.html#config_titlebar", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "titlebarChange", "url": "YAHOO.widget.Toolbar.html#event_titlebarChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "titleChange", "url": "YAHOO.widget.ToolbarButton.html#event_titleChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_toggleDesignMode", "url": "YAHOO.widget.SimpleEditor.html#method__toggleDesignMode", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "toolbar", "url": "YAHOO.widget.SimpleEditor.html#property_toolbar", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "toolbar", "url": "YAHOO.widget.SimpleEditor.html#config_toolbar", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "toolbarChange", "url": "YAHOO.widget.SimpleEditor.html#event_toolbarChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "toolbarCollapsed", "url": "YAHOO.widget.Toolbar.html#event_toolbarCollapsed", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Toolbar", "name": "_toolbarConfigs", "url": "YAHOO.widget.Toolbar.html#property__toolbarConfigs", "type": "property"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "toolbar_cont", "url": "YAHOO.widget.SimpleEditor.html#config_toolbar_cont", "type": "config"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "toolbarExpanded", "url": "YAHOO.widget.Toolbar.html#event_toolbarExpanded", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "toolbarLoaded", "url": "YAHOO.widget.SimpleEditor.html#event_toolbarLoaded", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "toString", "url": "YAHOO.widget.Editor.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.EditorWindow", "name": "toString", "url": "YAHOO.widget.EditorWindow.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "toString", "url": "YAHOO.widget.SimpleEditor.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.EditorInfo", "name": "toString", "url": "YAHOO.widget.EditorInfo.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "toString", "url": "YAHOO.widget.ToolbarButton.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "toString", "url": "YAHOO.widget.Toolbar.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "type", "url": "YAHOO.widget.ToolbarButton.html#config_type", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "typeChange", "url": "YAHOO.widget.ToolbarButton.html#event_typeChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_undoCache", "url": "YAHOO.widget.Editor.html#property__undoCache", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_undoLevel", "url": "YAHOO.widget.Editor.html#property__undoLevel", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_undoNodeChange", "url": "YAHOO.widget.Editor.html#method__undoNodeChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_updateMenuChecked", "url": "YAHOO.widget.SimpleEditor.html#method__updateMenuChecked", "type": "method"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "value", "url": "YAHOO.widget.ToolbarButton.html#config_value", "type": "config"}, {"access": "", "host": "YAHOO.widget.ToolbarButton", "name": "valueChange", "url": "YAHOO.widget.ToolbarButton.html#event_valueChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Toolbar", "name": "valueClick", "url": "YAHOO.widget.Toolbar.html#event_valueClick", "type": "event"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "width", "url": "YAHOO.widget.SimpleEditor.html#config_width", "type": "config"}, {"access": "", "host": "YAHOO.widget.SimpleEditor", "name": "widthChange", "url": "YAHOO.widget.SimpleEditor.html#event_widthChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.EditorInfo", "name": "window", "url": "YAHOO.widget.EditorInfo.html#property_window", "type": "property"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "windowCMDClose", "url": "YAHOO.widget.Editor.html#event_windowCMDClose", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "windowCMDOpen", "url": "YAHOO.widget.Editor.html#event_windowCMDOpen", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "windowCreateLinkRender", "url": "YAHOO.widget.Editor.html#event_windowCreateLinkRender", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "windowInsertImageRender", "url": "YAHOO.widget.Editor.html#event_windowInsertImageRender", "type": "event"}, {"access": "", "host": "YAHOO.widget.Editor", "name": "windowRender", "url": "YAHOO.widget.Editor.html#event_windowRender", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Editor", "name": "_windows", "url": "YAHOO.widget.Editor.html#method__windows", "type": "method"}, {"access": "private", "host": "YAHOO.widget.SimpleEditor", "name": "_writeDomPath", "url": "YAHOO.widget.SimpleEditor.html#method__writeDomPath", "type": "method"}];
</script>
</body>
</html>
